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
impl MemberEvent
Sourcepub fn membership(&self) -> &MembershipState
pub fn membership(&self) -> &MembershipState
The membership state of the user.
Sourcepub fn display_name(&self) -> DisplayName
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§impl<C> SyncOrStrippedState<C>where
C: StaticStateEventContent + RedactContent,
C::Redacted: RedactedStateEventContent<StateKey = C::StateKey> + Debug + Clone,
C::PossiblyRedacted: PossiblyRedactedStateEventContent<StateKey = C::StateKey>,
impl<C> SyncOrStrippedState<C>where
C: StaticStateEventContent + RedactContent,
C::Redacted: RedactedStateEventContent<StateKey = C::StateKey> + Debug + Clone,
C::PossiblyRedacted: PossiblyRedactedStateEventContent<StateKey = C::StateKey>,
Sourcepub fn as_sync(&self) -> Option<&SyncStateEvent<C>>
pub fn as_sync(&self) -> Option<&SyncStateEvent<C>>
If this is a SyncStateEvent
, return a reference to the inner event.
Sourcepub fn as_stripped(&self) -> Option<&StrippedStateEvent<C::PossiblyRedacted>>
pub fn as_stripped(&self) -> Option<&StrippedStateEvent<C::PossiblyRedacted>>
If this is a StrippedStateEvent
, return a reference to the inner
event.
Sourcepub fn origin_server_ts(&self) -> Option<MilliSecondsSinceUnixEpoch>
pub fn origin_server_ts(&self) -> Option<MilliSecondsSinceUnixEpoch>
The server timestamp of this event.
Source§impl<C> SyncOrStrippedState<C>where
C: StaticStateEventContent<PossiblyRedacted = C> + RedactContent + PossiblyRedactedStateEventContent,
C::Redacted: RedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey> + Debug + Clone,
impl<C> SyncOrStrippedState<C>where
C: StaticStateEventContent<PossiblyRedacted = C> + RedactContent + PossiblyRedactedStateEventContent,
C::Redacted: RedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey> + Debug + Clone,
Sourcepub fn original_content(&self) -> Option<&C>
pub fn original_content(&self) -> Option<&C>
The inner content of the wrapped event.
Trait Implementations
Source§impl<C> Clone for SyncOrStrippedState<C>where
C: StaticStateEventContent + RedactContent + Clone,
C::Redacted: RedactedStateEventContent + Debug + Clone,
C::PossiblyRedacted: Clone,
impl<C> Clone for SyncOrStrippedState<C>where
C: StaticStateEventContent + RedactContent + Clone,
C::Redacted: RedactedStateEventContent + Debug + Clone,
C::PossiblyRedacted: Clone,
Source§fn clone(&self) -> SyncOrStrippedState<C>
fn clone(&self) -> SyncOrStrippedState<C>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more