Type Alias MemberEvent

Source
pub type MemberEvent = SyncOrStrippedState<RoomMemberEventContent>;
Expand description

Wrapper around both MemberEvent-Types

Aliased Type§

enum MemberEvent {
    Sync(SyncStateEvent<RoomMemberEventContent>),
    Stripped(StrippedStateEvent<RoomMemberEventContent>),
}

Variants§

§

Sync(SyncStateEvent<RoomMemberEventContent>)

An event from a room in joined or left state.

§

Stripped(StrippedStateEvent<RoomMemberEventContent>)

An event from a room in invited state.

Implementations§

Source§

impl MemberEvent

Source

pub fn membership(&self) -> &MembershipState

The membership state of the user.

Source

pub fn user_id(&self) -> &UserId

The user id associated to this member event.

Source

pub fn display_name(&self) -> DisplayName

The name that should be displayed for this member event.

It there is no displayname in the event’s content, the localpart or the user ID is returned.

Source

pub fn reason(&self) -> Option<&str>

The optional reason why the membership changed.

Source

pub fn timestamp(&self) -> Option<UInt>

The optional timestamp for this member event.

Source§

impl<C> SyncOrStrippedState<C>

Source

pub fn as_sync(&self) -> Option<&SyncStateEvent<C>>

If this is a SyncStateEvent, return a reference to the inner event.

Source

pub fn as_stripped(&self) -> Option<&StrippedStateEvent<C::PossiblyRedacted>>

If this is a StrippedStateEvent, return a reference to the inner event.

Source

pub fn sender(&self) -> &UserId

The sender of this event.

Source

pub fn event_id(&self) -> Option<&EventId>

The ID of this event.

Source

pub fn origin_server_ts(&self) -> Option<MilliSecondsSinceUnixEpoch>

The server timestamp of this event.

Source

pub fn state_key(&self) -> &C::StateKey

The state key associated to this state event.

Source§

impl<C> SyncOrStrippedState<C>

Source

pub fn original_content(&self) -> Option<&C>

The inner content of the wrapped event.

Trait Implementations

Source§

impl<C> Clone for SyncOrStrippedState<C>

Source§

fn clone(&self) -> SyncOrStrippedState<C>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C> Debug for SyncOrStrippedState<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more