Enum StateEvent
pub enum StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,{
Original(OriginalStateEvent<C>),
Redacted(RedactedStateEvent<<C as RedactContent>::Redacted>),
}
Expand description
A possibly-redacted state event.
StateEvent
implements the comparison traits using only the event_id
field, a sorted list
would be sorted lexicographically based on the event’s EventId
.
Variants§
Original(OriginalStateEvent<C>)
Original, unredacted form of the event.
Redacted(RedactedStateEvent<<C as RedactContent>::Redacted>)
Redacted form of the event with minimal fields.
Implementations§
§impl<C> StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey> + RedactedStateEventContent,
impl<C> StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey> + RedactedStateEventContent,
pub fn event_type(&self) -> StateEventType
pub fn event_type(&self) -> StateEventType
Returns the type
of this event.
pub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
pub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
Returns this event’s origin_server_ts
field.
pub fn state_key(&self) -> &<C as StateEventContent>::StateKey
pub fn state_key(&self) -> &<C as StateEventContent>::StateKey
Returns this event’s state_key
field.
pub fn as_original(&self) -> Option<&OriginalStateEvent<C>>
pub fn as_original(&self) -> Option<&OriginalStateEvent<C>>
Get the inner OriginalStateEvent
if this is an unredacted event.
§impl StateEvent<RoomGuestAccessEventContent>
impl StateEvent<RoomGuestAccessEventContent>
pub fn guest_access(&self) -> &GuestAccess
pub fn guest_access(&self) -> &GuestAccess
Obtain the guest access policy, regardless of whether this event is redacted.
§impl StateEvent<RoomHistoryVisibilityEventContent>
impl StateEvent<RoomHistoryVisibilityEventContent>
pub fn history_visibility(&self) -> &HistoryVisibility
pub fn history_visibility(&self) -> &HistoryVisibility
Obtain the history visibility, regardless of whether this event is redacted.
§impl StateEvent<RoomMemberEventContent>
impl StateEvent<RoomMemberEventContent>
pub fn membership(&self) -> &MembershipState
pub fn membership(&self) -> &MembershipState
Obtain the membership state, regardless of whether this event is redacted.
§impl StateEvent<RoomPowerLevelsEventContent>
impl StateEvent<RoomPowerLevelsEventContent>
pub fn power_levels(
&self,
rules: &AuthorizationRules,
creators: Vec<OwnedUserId>,
) -> RoomPowerLevels
pub fn power_levels( &self, rules: &AuthorizationRules, creators: Vec<OwnedUserId>, ) -> RoomPowerLevels
Obtain the effective power levels, regardless of whether this event is redacted.
Trait Implementations§
§impl<C> Clone for StateEvent<C>where
C: Clone + StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent + Clone,
impl<C> Clone for StateEvent<C>where
C: Clone + StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent + Clone,
§fn clone(&self) -> StateEvent<C>
fn clone(&self) -> StateEvent<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<C> Debug for StateEvent<C>where
C: Debug + StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent + Debug,
impl<C> Debug for StateEvent<C>where
C: Debug + StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent + Debug,
§impl<'de, C> Deserialize<'de> for StateEvent<C>where
C: StaticStateEventContent + EventContentFromType + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey> + EventContentFromType + RedactedStateEventContent,
impl<'de, C> Deserialize<'de> for StateEvent<C>where
C: StaticStateEventContent + EventContentFromType + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent<StateKey = <C as StateEventContent>::StateKey> + EventContentFromType + RedactedStateEventContent,
§fn deserialize<D>(
deserializer: D,
) -> Result<StateEvent<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<StateEvent<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl From<StateEvent<BeaconInfoEventContent>> for AnyStateEvent
impl From<StateEvent<BeaconInfoEventContent>> for AnyStateEvent
§fn from(c: StateEvent<BeaconInfoEventContent>) -> AnyStateEvent
fn from(c: StateEvent<BeaconInfoEventContent>) -> AnyStateEvent
§impl<C> From<StateEvent<C>> for SyncStateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C> From<StateEvent<C>> for SyncStateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
§fn from(full: StateEvent<C>) -> SyncStateEvent<C>
fn from(full: StateEvent<C>) -> SyncStateEvent<C>
§impl From<StateEvent<CallMemberEventContent>> for AnyStateEvent
impl From<StateEvent<CallMemberEventContent>> for AnyStateEvent
§fn from(c: StateEvent<CallMemberEventContent>) -> AnyStateEvent
fn from(c: StateEvent<CallMemberEventContent>) -> AnyStateEvent
§impl From<StateEvent<MemberHintsEventContent>> for AnyStateEvent
impl From<StateEvent<MemberHintsEventContent>> for AnyStateEvent
§fn from(c: StateEvent<MemberHintsEventContent>) -> AnyStateEvent
fn from(c: StateEvent<MemberHintsEventContent>) -> AnyStateEvent
§impl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
§fn from(c: StateEvent<PolicyRuleRoomEventContent>) -> AnyStateEvent
fn from(c: StateEvent<PolicyRuleRoomEventContent>) -> AnyStateEvent
§impl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
§fn from(c: StateEvent<PolicyRuleServerEventContent>) -> AnyStateEvent
fn from(c: StateEvent<PolicyRuleServerEventContent>) -> AnyStateEvent
§impl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
§fn from(c: StateEvent<PolicyRuleUserEventContent>) -> AnyStateEvent
fn from(c: StateEvent<PolicyRuleUserEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomAliasesEventContent>> for AnyStateEvent
impl From<StateEvent<RoomAliasesEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomAliasesEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomAliasesEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
impl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomAvatarEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomAvatarEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomCanonicalAliasEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomCanonicalAliasEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomCreateEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomCreateEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
impl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomEncryptionEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomEncryptionEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
impl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomGuestAccessEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomGuestAccessEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
impl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomHistoryVisibilityEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomHistoryVisibilityEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
impl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomJoinRulesEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomJoinRulesEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
impl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomMemberEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomMemberEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
impl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomNameEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomNameEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomPinnedEventsEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomPinnedEventsEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomPowerLevelsEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomPowerLevelsEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
impl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomServerAclEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomServerAclEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
impl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomThirdPartyInviteEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomThirdPartyInviteEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomTombstoneEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomTombstoneEventContent>) -> AnyStateEvent
§impl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
§fn from(c: StateEvent<RoomTopicEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomTopicEventContent>) -> AnyStateEvent
§impl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
§fn from(c: StateEvent<SpaceChildEventContent>) -> AnyStateEvent
fn from(c: StateEvent<SpaceChildEventContent>) -> AnyStateEvent
§impl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
§fn from(c: StateEvent<SpaceParentEventContent>) -> AnyStateEvent
fn from(c: StateEvent<SpaceParentEventContent>) -> AnyStateEvent
§impl SpaceChildOrd for StateEvent<SpaceChildEventContent>
impl SpaceChildOrd for StateEvent<SpaceChildEventContent>
§fn cmp_space_child(&self, other: &impl SpaceChildOrd) -> Ordering
fn cmp_space_child(&self, other: &impl SpaceChildOrd) -> Ordering
Ordering
between self
and other
, using the algorithm for ordering
children within a space.impl<C> JsonCastable<AnyStateEvent> for StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C> JsonCastable<AnyStrippedStateEvent> for StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C> JsonCastable<AnySyncStateEvent> for StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C> JsonCastable<AnySyncTimelineEvent> for StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C> JsonCastable<AnyTimelineEvent> for StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl JsonCastable<HierarchySpaceChildEvent> for StateEvent<SpaceChildEventContent>
impl<C> JsonCastable<Map<String, Value>> for StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C> JsonCastable<StateEvent<C>> for OriginalStateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C> JsonCastable<StateEvent<C>> for RedactedStateEvent<<C as RedactContent>::Redacted>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C> JsonCastable<StrippedStateEvent<<C as StaticStateEventContent>::PossiblyRedacted>> for StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as StaticStateEventContent>::PossiblyRedacted: PossiblyRedactedStateEventContent,
impl<C> JsonCastable<SyncStateEvent<C>> for StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
Auto Trait Implementations§
impl<C> Freeze for StateEvent<C>where
<C as RedactContent>::Redacted: Sized + 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 StateEvent<C>where
<C as RedactContent>::Redacted: Sized + 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 StateEvent<C>where
<C as RedactContent>::Redacted: Sized + 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 StateEvent<C>where
<C as RedactContent>::Redacted: Sized + 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 StateEvent<C>where
<C as RedactContent>::Redacted: Sized + Unpin,
C: Unpin,
<C as StateEventContent>::StateKey: Unpin,
<C as StaticStateEventContent>::Unsigned: Unpin,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Unpin,
impl<C> UnwindSafe for StateEvent<C>where
<C as RedactContent>::Redacted: Sized + 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§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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