Trait matrix_sdk_crypto::RoomIdentityProvider

source ·
pub trait RoomIdentityProvider: Debug {
    // Required methods
    fn is_member<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 UserId,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn member_identities<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<UserIdentity>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn user_identity<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 UserId,
    ) -> Pin<Box<dyn Future<Output = Option<UserIdentity>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn state_of(&self, user_identity: &UserIdentity) -> IdentityState { ... }
}
Expand description

Something that can answer questions about the membership of a room and the identities of users.

This is implemented by matrix_sdk::Room and is a trait here so we can supply a mock when needed.

Required Methods§

source

fn is_member<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Is the user with the supplied ID a member of this room?

source

fn member_identities<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<UserIdentity>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return a list of the UserIdentity of all members of this room

source

fn user_identity<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 UserId, ) -> Pin<Box<dyn Future<Output = Option<UserIdentity>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return the UserIdentity of the user with the supplied ID (even if they are not a member of this room) or None if this user does not exist.

Provided Methods§

source

fn state_of(&self, user_identity: &UserIdentity) -> IdentityState

Return the IdentityState of the supplied user identity. Normally only overridden in tests.

Implementors§