[][src]Struct matrix_sdk::RoomMember

pub struct RoomMember {
    pub user_id: UserId,
    pub display_name: Option<String>,
    pub display_name_ambiguous: bool,
    pub avatar_url: Option<String>,
    pub last_active_ago: Option<UInt>,
    pub currently_active: Option<bool>,
    pub room_id: RoomId,
    pub typing: Option<bool>,
    pub presence: Option<PresenceState>,
    pub status_msg: Option<String>,
    pub power_level: Option<Int>,
    pub power_level_norm: Option<Int>,
    pub name: String,
    pub events: Vec<SyncStateEvent<MemberEventContent>, Global>,
    pub presence_events: Vec<PresenceEvent, Global>,
}

A Matrix room member.

Fields

user_id: UserId

The unique MXID of the user.

display_name: Option<String>

The human readable name of the user.

display_name_ambiguous: bool

Whether the member's display name is ambiguous due to being shared with other members.

avatar_url: Option<String>

The matrix url of the users avatar.

last_active_ago: Option<UInt>

The time, in ms, since the user interacted with the server.

currently_active: Option<bool>

If the user should be considered active.

room_id: RoomId

The unique id of the room.

typing: Option<bool>

If the member is typing.

presence: Option<PresenceState>

The presence of the user, if found.

status_msg: Option<String>

The presence status message, if found.

power_level: Option<Int>

The users power level.

power_level_norm: Option<Int>

The normalized power level of this RoomMember (0-100).

name: String

The human readable name of this room member.

events: Vec<SyncStateEvent<MemberEventContent>, Global>

The events that created the state of this room member.

presence_events: Vec<PresenceEvent, Global>

The PresenceEvents connected to this user.

Implementations

impl RoomMember[src]

pub fn new(
    event: &SyncStateEvent<MemberEventContent>,
    room_id: &RoomId
) -> RoomMember
[src]

Create a new room member.

Arguments

  • event - event associated with a member joining, leaving or getting invited to a room.

  • room_id - The unique id of the room this member is part of.

pub fn name(&self) -> String[src]

Returns the most ergonomic (but potentially ambiguous/non-unique) name available for the member.

This is the member's display name if it is set, otherwise their MXID.

pub fn unique_name(&self) -> String[src]

Returns a name for the member which is guaranteed to be unique, but not necessarily the most ergonomic.

This is either a name in the format "DISPLAY_NAME (MXID)" if the member's display name is set, or simply "MXID" if not.

pub fn disambiguated_name(&self) -> String[src]

Get the disambiguated display name for the member which is as ergonomic as possible while still guaranteeing it is unique.

If the member's display name is currently ambiguous (i.e. shared by other room members), this method will return the same result as RoomMember::unique_name. Otherwise, this method will return the same result as RoomMember::name.

This is usually the name you want when showing room messages from the member or when showing the member in the member list.

Warning: When displaying a room member's display name, clients must use a disambiguated name, so they must not use RoomMember::display_name directly. Clients should use this method to obtain the name, but an acceptable alternative is to use RoomMember::unique_name in certain situations.

Trait Implementations

impl Clone for RoomMember[src]

impl Debug for RoomMember[src]

impl<'de> Deserialize<'de> for RoomMember[src]

impl PartialEq<RoomMember> for RoomMember[src]

impl Serialize for RoomMember[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsyncTraitDeps for T where
    T: Send + Sync + Debug
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]