fractal::session::model::user

Trait UserExt

Source
pub trait UserExt: IsA<User> {
    // Provided methods
    fn session(&self) -> Session { ... }
    fn user_id(&self) -> &OwnedUserId { ... }
    fn is_own_user(&self) -> bool { ... }
    fn set_name(&self, name: Option<String>) { ... }
    fn set_avatar_url(&self, uri: Option<OwnedMxcUri>) { ... }
    fn matrix_to_uri(&self) -> MatrixToUri { ... }
    async fn load_profile(&self) { ... }
    fn is_ignored(&self) -> bool { ... }
    fn connect_is_ignored_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}

Provided Methods§

Source

fn session(&self) -> Session

The current session.

Source

fn user_id(&self) -> &OwnedUserId

The ID of this user.

Source

fn is_own_user(&self) -> bool

Whether this user is the same as the session’s user.

Source

fn set_name(&self, name: Option<String>)

Set the name of this user.

Source

fn set_avatar_url(&self, uri: Option<OwnedMxcUri>)

Set the avatar URL of this user.

Source

fn matrix_to_uri(&self) -> MatrixToUri

Get the matrix.to URI representation for this User.

Source

async fn load_profile(&self)

Load the user profile from the homeserver.

This overwrites the already loaded display name and avatar.

Source

fn is_ignored(&self) -> bool

Whether this user is currently ignored.

Source

fn connect_is_ignored_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Connect to the signal emitted when the is-ignored property changes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§