pub enum StateEvent<C: StaticStateEventContent + RedactContent>where
C::Redacted: RedactedStateEventContent,{
Original(OriginalStateEvent<C>),
Redacted(RedactedStateEvent<C::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::Redacted>)
Redacted form of the event with minimal fields.
Implementations§
Source§impl<C> StateEvent<C>where
C: StaticStateEventContent + RedactContent,
C::Redacted: RedactedStateEventContent + RedactedStateEventContent<StateKey = C::StateKey>,
impl<C> StateEvent<C>where
C: StaticStateEventContent + RedactContent,
C::Redacted: RedactedStateEventContent + RedactedStateEventContent<StateKey = C::StateKey>,
Sourcepub fn event_type(&self) -> StateEventType
pub fn event_type(&self) -> StateEventType
Returns the type of this event.
Sourcepub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
pub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
Returns this event’s origin_server_ts field.
Sourcepub 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.
Source§impl StateEvent<RoomGuestAccessEventContent>
impl StateEvent<RoomGuestAccessEventContent>
Sourcepub fn guest_access(&self) -> &GuestAccess
pub fn guest_access(&self) -> &GuestAccess
Obtain the guest access policy, regardless of whether this event is redacted.
Source§impl StateEvent<RoomHistoryVisibilityEventContent>
impl StateEvent<RoomHistoryVisibilityEventContent>
Sourcepub fn history_visibility(&self) -> &HistoryVisibility
pub fn history_visibility(&self) -> &HistoryVisibility
Obtain the history visibility, regardless of whether this event is redacted.
Source§impl StateEvent<RoomMemberEventContent>
impl StateEvent<RoomMemberEventContent>
Sourcepub fn membership(&self) -> &MembershipState
pub fn membership(&self) -> &MembershipState
Obtain the membership state, regardless of whether this event is redacted.
Sourcepub fn should_redact_events(&self) -> bool
pub fn should_redact_events(&self) -> bool
Determines whether the user’s events should be redacted based on their membership.
Using MSC4293, if redact_events is true, the sender is different to the state key,
and the membership is ban or leave (kick), true is returned. Otherwise, the flag
should be ignored, and false is returned.
Source§impl StateEvent<RoomPowerLevelsEventContent>
impl StateEvent<RoomPowerLevelsEventContent>
Sourcepub 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§
Source§impl<C: Clone + StaticStateEventContent + RedactContent> Clone for StateEvent<C>
impl<C: Clone + StaticStateEventContent + RedactContent> Clone for StateEvent<C>
Source§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 moreSource§impl<C: Debug + StaticStateEventContent + RedactContent> Debug for StateEvent<C>
impl<C: Debug + StaticStateEventContent + RedactContent> Debug for StateEvent<C>
Source§impl<'de, C> Deserialize<'de> for StateEvent<C>where
C: StaticStateEventContent + EventContentFromType + RedactContent,
C::Redacted: RedactedStateEventContent + EventContentFromType + RedactedStateEventContent<StateKey = C::StateKey>,
impl<'de, C> Deserialize<'de> for StateEvent<C>where
C: StaticStateEventContent + EventContentFromType + RedactContent,
C::Redacted: RedactedStateEventContent + EventContentFromType + RedactedStateEventContent<StateKey = C::StateKey>,
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl From<StateEvent<BeaconInfoEventContent>> for AnyStateEvent
Available on crate feature unstable-msc3489 only.
impl From<StateEvent<BeaconInfoEventContent>> for AnyStateEvent
unstable-msc3489 only.Source§fn from(c: BeaconInfoEvent) -> Self
fn from(c: BeaconInfoEvent) -> Self
Source§impl<C> From<StateEvent<C>> for SyncStateEvent<C>
impl<C> From<StateEvent<C>> for SyncStateEvent<C>
Source§fn from(full: StateEvent<C>) -> Self
fn from(full: StateEvent<C>) -> Self
Source§impl From<StateEvent<CallMemberEventContent>> for AnyStateEvent
Available on crate feature unstable-msc3401 only.
impl From<StateEvent<CallMemberEventContent>> for AnyStateEvent
unstable-msc3401 only.Source§fn from(c: CallMemberEvent) -> Self
fn from(c: CallMemberEvent) -> Self
Source§impl From<StateEvent<MemberHintsEventContent>> for AnyStateEvent
Available on crate feature unstable-msc4171 only.
impl From<StateEvent<MemberHintsEventContent>> for AnyStateEvent
unstable-msc4171 only.Source§fn from(c: MemberHintsEvent) -> Self
fn from(c: MemberHintsEvent) -> Self
Source§impl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
Source§fn from(c: PolicyRuleRoomEvent) -> Self
fn from(c: PolicyRuleRoomEvent) -> Self
Source§impl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
Source§fn from(c: PolicyRuleServerEvent) -> Self
fn from(c: PolicyRuleServerEvent) -> Self
Source§impl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
Source§fn from(c: PolicyRuleUserEvent) -> Self
fn from(c: PolicyRuleUserEvent) -> Self
Source§impl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
impl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
Source§fn from(c: RoomAvatarEvent) -> Self
fn from(c: RoomAvatarEvent) -> Self
Source§impl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
Source§fn from(c: RoomCanonicalAliasEvent) -> Self
fn from(c: RoomCanonicalAliasEvent) -> Self
Source§impl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
Source§fn from(c: RoomCreateEvent) -> Self
fn from(c: RoomCreateEvent) -> Self
Source§impl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
impl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
Source§fn from(c: RoomEncryptionEvent) -> Self
fn from(c: RoomEncryptionEvent) -> Self
Source§impl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
impl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
Source§fn from(c: RoomGuestAccessEvent) -> Self
fn from(c: RoomGuestAccessEvent) -> Self
Source§impl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
impl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
Source§fn from(c: RoomHistoryVisibilityEvent) -> Self
fn from(c: RoomHistoryVisibilityEvent) -> Self
Source§impl From<StateEvent<RoomImagePackEventContent>> for AnyStateEvent
Available on crate feature unstable-msc2545 only.
impl From<StateEvent<RoomImagePackEventContent>> for AnyStateEvent
unstable-msc2545 only.Source§fn from(c: RoomImagePackEvent) -> Self
fn from(c: RoomImagePackEvent) -> Self
Source§impl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
impl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
Source§fn from(c: RoomJoinRulesEvent) -> Self
fn from(c: RoomJoinRulesEvent) -> Self
Source§impl From<StateEvent<RoomLanguageEventContent>> for AnyStateEvent
Available on crate feature unstable-msc4334 only.
impl From<StateEvent<RoomLanguageEventContent>> for AnyStateEvent
unstable-msc4334 only.Source§fn from(c: RoomLanguageEvent) -> Self
fn from(c: RoomLanguageEvent) -> Self
Source§impl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
impl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
Source§fn from(c: RoomMemberEvent) -> Self
fn from(c: RoomMemberEvent) -> Self
Source§impl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
impl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
Source§fn from(c: RoomNameEvent) -> Self
fn from(c: RoomNameEvent) -> Self
Source§impl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
Source§fn from(c: RoomPinnedEventsEvent) -> Self
fn from(c: RoomPinnedEventsEvent) -> Self
Source§impl From<StateEvent<RoomPolicyEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPolicyEventContent>> for AnyStateEvent
Source§fn from(c: RoomPolicyEvent) -> Self
fn from(c: RoomPolicyEvent) -> Self
Source§impl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
Source§fn from(c: RoomPowerLevelsEvent) -> Self
fn from(c: RoomPowerLevelsEvent) -> Self
Source§impl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
impl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
Source§fn from(c: RoomServerAclEvent) -> Self
fn from(c: RoomServerAclEvent) -> Self
Source§impl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
impl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
Source§fn from(c: RoomThirdPartyInviteEvent) -> Self
fn from(c: RoomThirdPartyInviteEvent) -> Self
Source§impl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
Source§fn from(c: RoomTombstoneEvent) -> Self
fn from(c: RoomTombstoneEvent) -> Self
Source§impl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
Source§fn from(c: RoomTopicEvent) -> Self
fn from(c: RoomTopicEvent) -> Self
Source§impl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
Source§fn from(c: SpaceChildEvent) -> Self
fn from(c: SpaceChildEvent) -> Self
Source§impl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
Source§fn from(c: SpaceParentEvent) -> Self
fn from(c: SpaceParentEvent) -> Self
Source§impl From<StateEvent<StateRoomEncryptedEventContent>> for AnyStateEvent
Available on crate feature unstable-msc4362 only.
impl From<StateEvent<StateRoomEncryptedEventContent>> for AnyStateEvent
unstable-msc4362 only.Source§fn from(c: StateRoomEncryptedEvent) -> Self
fn from(c: StateRoomEncryptedEvent) -> Self
impl<C: StaticStateEventContent + RedactContent> JsonCastable<AnyStateEvent> for StateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<AnyStrippedStateEvent> for StateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<AnySyncStateEvent> for StateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<AnySyncTimelineEvent> for StateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<AnyTimelineEvent> for StateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<Map<String, Value>> for StateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<StateEvent<C>> for OriginalStateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<StateEvent<C>> for RedactedStateEvent<C::Redacted>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<StrippedStateEvent<<C as StaticStateEventContent>::PossiblyRedacted>> for StateEvent<C>
impl<C: StaticStateEventContent + RedactContent> JsonCastable<SyncStateEvent<C>> for StateEvent<C>where
C::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> UnsafeUnpin for StateEvent<C>where
<C as RedactContent>::Redacted: Sized + 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 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,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more