Enum ruma_common::events::StateEvent
source · pub enum StateEvent<C: StaticStateEventContent + RedactContent>where
C::Redacted: RedactedStateEventContent,{
Original(OriginalStateEvent<C>),
Redacted(RedactedStateEvent<C::Redacted>),
}Available on crate feature
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::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.
source§impl StateEvent<RoomPowerLevelsEventContent>
impl StateEvent<RoomPowerLevelsEventContent>
sourcepub fn power_levels(&self) -> RoomPowerLevels
pub fn power_levels(&self) -> 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>where
C::Redacted: RedactedStateEventContent + Clone,
impl<C: Clone + StaticStateEventContent + RedactContent> Clone for StateEvent<C>where
C::Redacted: RedactedStateEventContent + Clone,
source§fn clone(&self) -> StateEvent<C>
fn clone(&self) -> StateEvent<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 + StaticStateEventContent + RedactContent> Debug for StateEvent<C>where
C::Redacted: RedactedStateEventContent + Debug,
impl<C: Debug + StaticStateEventContent + RedactContent> Debug for StateEvent<C>where
C::Redacted: RedactedStateEventContent + Debug,
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<C> From<StateEvent<C>> for SyncStateEvent<C>where
C: StaticStateEventContent + RedactContent,
C::Redacted: RedactedStateEventContent,
impl<C> From<StateEvent<C>> for SyncStateEvent<C>where
C: StaticStateEventContent + RedactContent,
C::Redacted: RedactedStateEventContent,
source§fn from(full: StateEvent<C>) -> Self
fn from(full: StateEvent<C>) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
source§fn from(c: PolicyRuleRoomEvent) -> Self
fn from(c: PolicyRuleRoomEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
source§fn from(c: PolicyRuleServerEvent) -> Self
fn from(c: PolicyRuleServerEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
source§fn from(c: PolicyRuleUserEvent) -> Self
fn from(c: PolicyRuleUserEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomAliasesEventContent>> for AnyStateEvent
impl From<StateEvent<RoomAliasesEventContent>> for AnyStateEvent
source§fn from(c: RoomAliasesEvent) -> Self
fn from(c: RoomAliasesEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
impl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
source§fn from(c: RoomAvatarEvent) -> Self
fn from(c: RoomAvatarEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
source§fn from(c: RoomCanonicalAliasEvent) -> Self
fn from(c: RoomCanonicalAliasEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
source§fn from(c: RoomCreateEvent) -> Self
fn from(c: RoomCreateEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
impl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
source§fn from(c: RoomEncryptionEvent) -> Self
fn from(c: RoomEncryptionEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
impl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
source§fn from(c: RoomGuestAccessEvent) -> Self
fn from(c: RoomGuestAccessEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
impl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
source§fn from(c: RoomHistoryVisibilityEvent) -> Self
fn from(c: RoomHistoryVisibilityEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
impl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
source§fn from(c: RoomJoinRulesEvent) -> Self
fn from(c: RoomJoinRulesEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
impl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
source§fn from(c: RoomMemberEvent) -> Self
fn from(c: RoomMemberEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
impl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
source§fn from(c: RoomNameEvent) -> Self
fn from(c: RoomNameEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
source§fn from(c: RoomPinnedEventsEvent) -> Self
fn from(c: RoomPinnedEventsEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
source§fn from(c: RoomPowerLevelsEvent) -> Self
fn from(c: RoomPowerLevelsEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
impl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
source§fn from(c: RoomServerAclEvent) -> Self
fn from(c: RoomServerAclEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
impl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
source§fn from(c: RoomThirdPartyInviteEvent) -> Self
fn from(c: RoomThirdPartyInviteEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
source§fn from(c: RoomTombstoneEvent) -> Self
fn from(c: RoomTombstoneEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
source§fn from(c: RoomTopicEvent) -> Self
fn from(c: RoomTopicEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
source§fn from(c: SpaceChildEvent) -> Self
fn from(c: SpaceChildEvent) -> Self
Converts to this type from the input type.
source§impl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
source§fn from(c: SpaceParentEvent) -> Self
fn from(c: SpaceParentEvent) -> Self
Converts to this type from the input type.