pub enum SyncOrStrippedState<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent + Debug + Clone,{
Sync(SyncStateEvent<C>),
Stripped(StrippedStateEvent<<C as StaticStateEventContent>::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 as StaticStateEventContent>::PossiblyRedacted>)
An event from a room in invited state.
Implementations§
Source§impl<C> SyncOrStrippedState<C>where
C: RedactContent + StaticStateEventContent,
<C as RedactContent>::Redacted: RedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey> + Debug + Clone,
<C as StaticStateEventContent>::PossiblyRedacted: PossiblyRedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey>,
impl<C> SyncOrStrippedState<C>where
C: RedactContent + StaticStateEventContent,
<C as RedactContent>::Redacted: RedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey> + Debug + Clone,
<C as StaticStateEventContent>::PossiblyRedacted: PossiblyRedactedStateEventContent<StateKey = <C as StateEventContent>::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 as StaticStateEventContent>::PossiblyRedacted>>
pub fn as_stripped( &self, ) -> Option<&StrippedStateEvent<<C as StaticStateEventContent>::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.
Sourcepub fn state_key(&self) -> &<C as StateEventContent>::StateKey
pub fn state_key(&self) -> &<C as StateEventContent>::StateKey
The state key associated to this state event.
Source§impl<C> SyncOrStrippedState<C>where
C: RedactContent + PossiblyRedactedStateEventContent + StaticStateEventContent<PossiblyRedacted = C>,
<C as RedactContent>::Redacted: RedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey> + Debug + Clone,
impl<C> SyncOrStrippedState<C>where
C: RedactContent + PossiblyRedactedStateEventContent + StaticStateEventContent<PossiblyRedacted = C>,
<C as RedactContent>::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 displayname_value(&self) -> Option<&str>
pub fn displayname_value(&self) -> Option<&str>
The value of the displayname field in this member event.
MemberEvent::display_name() should be preferred to get the name to
display for this member event.
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.
Sourcepub fn avatar_url(&self) -> Option<&MxcUri>
pub fn avatar_url(&self) -> Option<&MxcUri>
The URL of the avatar in this member event.
MemberEvent::display_name() should be preferred to get the name to
display for this member event.
Source§impl SyncOrStrippedState<RoomPowerLevelsEventContent>
impl SyncOrStrippedState<RoomPowerLevelsEventContent>
Sourcepub fn power_levels(
&self,
rules: &AuthorizationRules,
creators: Vec<OwnedUserId>,
) -> RoomPowerLevels
pub fn power_levels( &self, rules: &AuthorizationRules, creators: Vec<OwnedUserId>, ) -> RoomPowerLevels
The power levels of the event.
Trait Implementations§
Source§impl<C> Clone for SyncOrStrippedState<C>where
C: Clone + StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent + Debug + Clone,
<C as StaticStateEventContent>::PossiblyRedacted: Clone,
impl<C> Clone for SyncOrStrippedState<C>where
C: Clone + StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent + Debug + Clone,
<C as StaticStateEventContent>::PossiblyRedacted: Clone,
Source§fn clone(&self) -> SyncOrStrippedState<C>
fn clone(&self) -> SyncOrStrippedState<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<C> Debug for SyncOrStrippedState<C>where
C: Debug + StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent + Debug + Clone,
<C as StaticStateEventContent>::PossiblyRedacted: Debug,
impl<C> Debug for SyncOrStrippedState<C>where
C: Debug + StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent + Debug + Clone,
<C as StaticStateEventContent>::PossiblyRedacted: Debug,
Auto Trait Implementations§
impl<C> Freeze for SyncOrStrippedState<C>where
<C as RedactContent>::Redacted: Sized + Freeze,
<C as StaticStateEventContent>::PossiblyRedacted: Freeze,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: Freeze,
C: Freeze,
<C as StateEventContent>::StateKey: Freeze,
<C as StaticStateEventContent>::Unsigned: Freeze,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Freeze,
impl<C> RefUnwindSafe for SyncOrStrippedState<C>where
<C as RedactContent>::Redacted: Sized + RefUnwindSafe,
<C as StaticStateEventContent>::PossiblyRedacted: RefUnwindSafe,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: RefUnwindSafe,
C: RefUnwindSafe,
<C as StateEventContent>::StateKey: RefUnwindSafe,
<C as StaticStateEventContent>::Unsigned: RefUnwindSafe,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: RefUnwindSafe,
impl<C> Send for SyncOrStrippedState<C>where
<C as RedactContent>::Redacted: Sized + Send,
<C as StaticStateEventContent>::PossiblyRedacted: Send,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: Send,
C: Send,
<C as StateEventContent>::StateKey: Send,
<C as StaticStateEventContent>::Unsigned: Send,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Send,
impl<C> Sync for SyncOrStrippedState<C>where
<C as RedactContent>::Redacted: Sized + Sync,
<C as StaticStateEventContent>::PossiblyRedacted: Sync,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: Sync,
C: Sync,
<C as StateEventContent>::StateKey: Sync,
<C as StaticStateEventContent>::Unsigned: Sync,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Sync,
impl<C> Unpin for SyncOrStrippedState<C>where
<C as RedactContent>::Redacted: Sized + Unpin,
<C as StaticStateEventContent>::PossiblyRedacted: Unpin,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: Unpin,
C: Unpin,
<C as StateEventContent>::StateKey: Unpin,
<C as StaticStateEventContent>::Unsigned: Unpin,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Unpin,
impl<C> UnsafeUnpin for SyncOrStrippedState<C>where
<C as RedactContent>::Redacted: Sized + UnsafeUnpin,
<C as StaticStateEventContent>::PossiblyRedacted: UnsafeUnpin,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: UnsafeUnpin,
C: UnsafeUnpin,
<C as StateEventContent>::StateKey: UnsafeUnpin,
<C as StaticStateEventContent>::Unsigned: UnsafeUnpin,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: UnsafeUnpin,
impl<C> UnwindSafe for SyncOrStrippedState<C>where
<C as RedactContent>::Redacted: Sized + UnwindSafe,
<C as StaticStateEventContent>::PossiblyRedacted: UnwindSafe,
<<C as StaticStateEventContent>::PossiblyRedacted as PossiblyRedactedStateEventContent>::StateKey: UnwindSafe,
C: UnwindSafe,
<C as StateEventContent>::StateKey: UnwindSafe,
<C as StaticStateEventContent>::Unsigned: UnwindSafe,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more