Skip to main content

RoomIdentityProvider

Trait RoomIdentityProvider 

Source
pub trait RoomIdentityProvider: Debug {
    // Required methods
    fn is_member<'a>(&'a self, user_id: &'a UserId) -> BoxFuture<'a, bool>;
    fn member_identities(&self) -> BoxFuture<'_, Vec<UserIdentity>>;
    fn user_identity<'a>(
        &'a self,
        user_id: &'a UserId,
    ) -> BoxFuture<'a, Option<UserIdentity>>;

    // 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<'a>(&'a self, user_id: &'a UserId) -> BoxFuture<'a, bool>

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

Source

fn member_identities(&self) -> BoxFuture<'_, Vec<UserIdentity>>

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

Source

fn user_identity<'a>( &'a self, user_id: &'a UserId, ) -> BoxFuture<'a, Option<UserIdentity>>

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§