pub enum SyncOrStrippedState<C>where
C: StaticStateEventContent + RedactContent,
C::Redacted: RedactedStateEventContent + Debug + Clone,{
Sync(SyncStateEvent<C>),
Stripped(StrippedStateEvent<C::PossiblyRedacted>),
}
Expand description
Wrapper around both versions of a state event.
Variants§
Sync(SyncStateEvent<C>)
An event from a room in joined or left state.
Stripped(StrippedStateEvent<C::PossiblyRedacted>)
An event from a room in invited state.
Implementations§
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.
source§impl SyncOrStrippedState<RoomMemberEventContent>
impl SyncOrStrippedState<RoomMemberEventContent>
sourcepub fn membership(&self) -> &MembershipState
pub fn membership(&self) -> &MembershipState
The membership state of the user.
sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
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 SyncOrStrippedState<RoomPowerLevelsEventContent>
impl SyncOrStrippedState<RoomPowerLevelsEventContent>
sourcepub fn power_levels(&self) -> RoomPowerLevels
pub fn power_levels(&self) -> RoomPowerLevels
The power levels of the 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 moresource§impl<C> Debug for SyncOrStrippedState<C>where
C: StaticStateEventContent + RedactContent + Debug,
C::Redacted: RedactedStateEventContent + Debug + Clone,
C::PossiblyRedacted: Debug,
impl<C> Debug for SyncOrStrippedState<C>where
C: StaticStateEventContent + RedactContent + Debug,
C::Redacted: RedactedStateEventContent + Debug + Clone,
C::PossiblyRedacted: Debug,
Auto Trait Implementations§
impl<C> RefUnwindSafe for SyncOrStrippedState<C>where
C: RefUnwindSafe,
<C as StaticStateEventContent>::PossiblyRedacted: RefUnwindSafe,
<C as RedactContent>::Redacted: RefUnwindSafe,
<C as StateEventContent>::StateKey: RefUnwindSafe,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: RefUnwindSafe,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: RefUnwindSafe,
<C as StaticStateEventContent>::Unsigned: RefUnwindSafe,
impl<C> Send for SyncOrStrippedState<C>where
C: Send,
<C as StaticStateEventContent>::PossiblyRedacted: Send,
<C as RedactContent>::Redacted: Send,
<C as StateEventContent>::StateKey: Send,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: Send,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Send,
<C as StaticStateEventContent>::Unsigned: Send,
impl<C> Sync for SyncOrStrippedState<C>where
C: Sync,
<C as StaticStateEventContent>::PossiblyRedacted: Sync,
<C as RedactContent>::Redacted: Sync,
<C as StateEventContent>::StateKey: Sync,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: Sync,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Sync,
<C as StaticStateEventContent>::Unsigned: Sync,
impl<C> Unpin for SyncOrStrippedState<C>where
C: Unpin,
<C as StaticStateEventContent>::PossiblyRedacted: Unpin,
<C as RedactContent>::Redacted: Unpin,
<C as StateEventContent>::StateKey: Unpin,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: Unpin,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Unpin,
<C as StaticStateEventContent>::Unsigned: Unpin,
impl<C> UnwindSafe for SyncOrStrippedState<C>where
C: UnwindSafe,
<C as StaticStateEventContent>::PossiblyRedacted: UnwindSafe,
<C as RedactContent>::Redacted: UnwindSafe,
<C as StateEventContent>::StateKey: UnwindSafe,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: UnwindSafe,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: UnwindSafe,
<C as StaticStateEventContent>::Unsigned: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more