pub enum StateEvent<C>where
C: StaticStateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,{
Original(OriginalStateEvent<C>),
Redacted(RedactedStateEvent<<C as RedactContent>::Redacted>),
}events only.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§
Source§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,
Sourcepub fn event_type(&self) -> StateEventType
Available on crate feature unstable-msc3489 only.
pub fn event_type(&self) -> StateEventType
unstable-msc3489 only.Returns the type of this event.
Sourcepub fn event_id(&self) -> &EventId
Available on crate feature unstable-msc3489 only.
pub fn event_id(&self) -> &EventId
unstable-msc3489 only.Returns this event’s event_id field.
Sourcepub fn sender(&self) -> &UserId
Available on crate feature unstable-msc3489 only.
pub fn sender(&self) -> &UserId
unstable-msc3489 only.Returns this event’s sender field.
Sourcepub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
Available on crate feature unstable-msc3489 only.
pub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
unstable-msc3489 only.Returns this event’s origin_server_ts field.
Sourcepub fn room_id(&self) -> &RoomId
Available on crate feature unstable-msc3489 only.
pub fn room_id(&self) -> &RoomId
unstable-msc3489 only.Returns this event’s room_id field.
Sourcepub fn state_key(&self) -> &<C as StateEventContent>::StateKey
Available on crate feature unstable-msc3489 only.
pub fn state_key(&self) -> &<C as StateEventContent>::StateKey
unstable-msc3489 only.Returns this event’s state_key field.
Sourcepub fn as_original(&self) -> Option<&OriginalStateEvent<C>>
Available on crate feature unstable-msc3489 only.
pub fn as_original(&self) -> Option<&OriginalStateEvent<C>>
unstable-msc3489 only.Get the inner OriginalStateEvent if this is an unredacted event.
Source§impl StateEvent<RoomGuestAccessEventContent>
impl StateEvent<RoomGuestAccessEventContent>
Sourcepub fn guest_access(&self) -> &GuestAccess
Available on crate feature unstable-msc3489 only.
pub fn guest_access(&self) -> &GuestAccess
unstable-msc3489 only.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
Available on crate feature unstable-msc3489 only.
pub fn history_visibility(&self) -> &HistoryVisibility
unstable-msc3489 only.Obtain the history visibility, regardless of whether this event is redacted.
Source§impl StateEvent<RoomMemberEventContent>
impl StateEvent<RoomMemberEventContent>
Sourcepub fn membership(&self) -> &MembershipState
Available on crate feature unstable-msc3489 only.
pub fn membership(&self) -> &MembershipState
unstable-msc3489 only.Obtain the membership state, regardless of whether this event is redacted.
Source§impl StateEvent<RoomPowerLevelsEventContent>
impl StateEvent<RoomPowerLevelsEventContent>
Sourcepub fn power_levels(
&self,
rules: &AuthorizationRules,
creators: Vec<OwnedUserId>,
) -> RoomPowerLevels
Available on crate feature unstable-msc3489 only.
pub fn power_levels( &self, rules: &AuthorizationRules, creators: Vec<OwnedUserId>, ) -> RoomPowerLevels
unstable-msc3489 only.Obtain the effective power levels, regardless of whether this event is redacted.
Trait Implementations§
Source§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,
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 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,
Source§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,
Source§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>,
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: StateEvent<BeaconInfoEventContent>) -> AnyStateEvent
fn from(c: StateEvent<BeaconInfoEventContent>) -> AnyStateEvent
Source§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,
Source§fn from(full: StateEvent<C>) -> SyncStateEvent<C>
fn from(full: StateEvent<C>) -> SyncStateEvent<C>
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: StateEvent<CallMemberEventContent>) -> AnyStateEvent
fn from(c: StateEvent<CallMemberEventContent>) -> AnyStateEvent
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: StateEvent<MemberHintsEventContent>) -> AnyStateEvent
fn from(c: StateEvent<MemberHintsEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<PolicyRuleRoomEventContent>) -> AnyStateEvent
fn from(c: StateEvent<PolicyRuleRoomEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<PolicyRuleServerEventContent>) -> AnyStateEvent
fn from(c: StateEvent<PolicyRuleServerEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<PolicyRuleUserEventContent>) -> AnyStateEvent
fn from(c: StateEvent<PolicyRuleUserEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomAliasesEventContent>> for AnyStateEvent
impl From<StateEvent<RoomAliasesEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomAliasesEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomAliasesEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
impl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomAvatarEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomAvatarEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomCanonicalAliasEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomCanonicalAliasEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomCreateEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomCreateEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
impl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomEncryptionEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomEncryptionEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
impl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomGuestAccessEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomGuestAccessEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
impl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomHistoryVisibilityEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomHistoryVisibilityEventContent>) -> AnyStateEvent
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: StateEvent<RoomImagePackEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomImagePackEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
impl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomJoinRulesEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomJoinRulesEventContent>) -> AnyStateEvent
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: StateEvent<RoomLanguageEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomLanguageEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
impl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomMemberEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomMemberEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
impl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomNameEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomNameEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomPinnedEventsEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomPinnedEventsEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomPowerLevelsEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomPowerLevelsEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
impl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomServerAclEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomServerAclEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
impl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomThirdPartyInviteEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomThirdPartyInviteEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomTombstoneEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomTombstoneEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<RoomTopicEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomTopicEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<SpaceChildEventContent>) -> AnyStateEvent
fn from(c: StateEvent<SpaceChildEventContent>) -> AnyStateEvent
Source§impl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
Source§fn from(c: StateEvent<SpaceParentEventContent>) -> AnyStateEvent
fn from(c: StateEvent<SpaceParentEventContent>) -> AnyStateEvent
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: StateEvent<StateRoomEncryptedEventContent>) -> AnyStateEvent
fn from(c: StateEvent<StateRoomEncryptedEventContent>) -> AnyStateEvent
Source§impl SpaceChildOrd for StateEvent<SpaceChildEventContent>
impl SpaceChildOrd for StateEvent<SpaceChildEventContent>
Source§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.