pub trait FetchState:
Copy
+ Send
+ Sync {
type Pdu: Event;
// Required method
fn get(
self,
ty: StateEventType,
key: StateKey,
) -> impl Future<Output = Result<Self::Pdu>> + Send;
// Provided methods
fn room_create_event(
self,
) -> impl Future<Output = Result<RoomCreateEvent<Self::Pdu>>> + Send { ... }
fn user_membership(
self,
user_id: &UserId,
) -> impl Future<Output = Result<MembershipState>> + Send { ... }
fn room_power_levels_event(
self,
) -> impl Future<Output = Result<Option<RoomPowerLevelsEvent<Self::Pdu>>>> + Send { ... }
fn join_rule(self) -> impl Future<Output = Result<JoinRule>> + Send { ... }
fn room_third_party_invite_event(
self,
token: &str,
) -> impl Future<Output = Result<Option<RoomThirdPartyInviteEvent<Self::Pdu>>>> + Send { ... }
}Expand description
Reads authorization state through a copyable handle.
Implementations may return owned events or borrow events held by the state snapshot.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn room_create_event(
self,
) -> impl Future<Output = Result<RoomCreateEvent<Self::Pdu>>> + Send
fn room_create_event( self, ) -> impl Future<Output = Result<RoomCreateEvent<Self::Pdu>>> + Send
Reads the room creation event.
Missing creation state is an authorization input error.
Sourcefn user_membership(
self,
user_id: &UserId,
) -> impl Future<Output = Result<MembershipState>> + Send
fn user_membership( self, user_id: &UserId, ) -> impl Future<Output = Result<MembershipState>> + Send
Reads a user membership from the state snapshot.
Missing membership follows the member-event defaulting rules.
Sourcefn room_power_levels_event(
self,
) -> impl Future<Output = Result<Option<RoomPowerLevelsEvent<Self::Pdu>>>> + Send
fn room_power_levels_event( self, ) -> impl Future<Output = Result<Option<RoomPowerLevelsEvent<Self::Pdu>>>> + Send
Reads the optional room power levels event.
Missing power levels return no event.
Sourcefn join_rule(self) -> impl Future<Output = Result<JoinRule>> + Send
fn join_rule(self) -> impl Future<Output = Result<JoinRule>> + Send
Reads the current room join rule.
Missing join-rule state is an authorization input error.
Sourcefn room_third_party_invite_event(
self,
token: &str,
) -> impl Future<Output = Result<Option<RoomThirdPartyInviteEvent<Self::Pdu>>>> + Send
fn room_third_party_invite_event( self, token: &str, ) -> impl Future<Output = Result<Option<RoomThirdPartyInviteEvent<Self::Pdu>>>> + Send
Reads the invitation matching a third-party token.
Missing invitation state returns no event.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".