Enum ruma::events::StateEvent
source · [−]pub enum StateEvent<C>where
C: StateEventContent + 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
sourceimpl<C> StateEvent<C>where
C: StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: StateEventContent,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey == <C as StateEventContent>::StateKey,
impl<C> StateEvent<C>where
C: StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: StateEventContent,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey == <C as StateEventContent>::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 state_key(&self) -> &<C as StateEventContent>::StateKey
pub fn state_key(&self) -> &<C as StateEventContent>::StateKey
Returns this event’s state_key
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.
sourceimpl 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.
sourceimpl 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.
sourceimpl 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.
sourceimpl 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
sourceimpl<C> Clone for StateEvent<C>where
C: Clone + StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: Clone,
impl<C> Clone for StateEvent<C>where
C: Clone + StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: Clone,
sourcefn clone(&self) -> StateEvent<C>
fn clone(&self) -> StateEvent<C>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<C> Debug for StateEvent<C>where
C: Debug + StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: Debug,
impl<C> Debug for StateEvent<C>where
C: Debug + StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: Debug,
sourceimpl<'de, C> Deserialize<'de> for StateEvent<C>where
C: StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: StateEventContent,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey == <C as StateEventContent>::StateKey,
impl<'de, C> Deserialize<'de> for StateEvent<C>where
C: StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: StateEventContent,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey == <C as StateEventContent>::StateKey,
sourcefn 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>,
sourceimpl<C> From<StateEvent<C>> for SyncStateEvent<C>where
C: StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C> From<StateEvent<C>> for SyncStateEvent<C>where
C: StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
sourcefn from(full: StateEvent<C>) -> SyncStateEvent<C>
fn from(full: StateEvent<C>) -> SyncStateEvent<C>
sourceimpl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleRoomEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<PolicyRuleRoomEventContent>) -> AnyStateEvent
fn from(c: StateEvent<PolicyRuleRoomEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleServerEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<PolicyRuleServerEventContent>) -> AnyStateEvent
fn from(c: StateEvent<PolicyRuleServerEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
impl From<StateEvent<PolicyRuleUserEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<PolicyRuleUserEventContent>) -> AnyStateEvent
fn from(c: StateEvent<PolicyRuleUserEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomAliasesEventContent>> for AnyStateEvent
impl From<StateEvent<RoomAliasesEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomAliasesEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomAliasesEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
impl From<StateEvent<RoomAvatarEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomAvatarEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomAvatarEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCanonicalAliasEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomCanonicalAliasEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomCanonicalAliasEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
impl From<StateEvent<RoomCreateEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomCreateEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomCreateEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
impl From<StateEvent<RoomEncryptionEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomEncryptionEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomEncryptionEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
impl From<StateEvent<RoomGuestAccessEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomGuestAccessEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomGuestAccessEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
impl From<StateEvent<RoomHistoryVisibilityEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomHistoryVisibilityEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomHistoryVisibilityEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
impl From<StateEvent<RoomJoinRulesEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomJoinRulesEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomJoinRulesEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
impl From<StateEvent<RoomMemberEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomMemberEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomMemberEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
impl From<StateEvent<RoomNameEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomNameEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomNameEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPinnedEventsEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomPinnedEventsEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomPinnedEventsEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
impl From<StateEvent<RoomPowerLevelsEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomPowerLevelsEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomPowerLevelsEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
impl From<StateEvent<RoomServerAclEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomServerAclEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomServerAclEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
impl From<StateEvent<RoomThirdPartyInviteEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomThirdPartyInviteEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomThirdPartyInviteEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTombstoneEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomTombstoneEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomTombstoneEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
impl From<StateEvent<RoomTopicEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<RoomTopicEventContent>) -> AnyStateEvent
fn from(c: StateEvent<RoomTopicEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceChildEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<SpaceChildEventContent>) -> AnyStateEvent
fn from(c: StateEvent<SpaceChildEventContent>) -> AnyStateEvent
sourceimpl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
impl From<StateEvent<SpaceParentEventContent>> for AnyStateEvent
sourcefn from(c: StateEvent<SpaceParentEventContent>) -> AnyStateEvent
fn from(c: StateEvent<SpaceParentEventContent>) -> AnyStateEvent
sourceimpl<C> Redact for StateEvent<C>where
C: StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: StateEventContent,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey == <C as StateEventContent>::StateKey,
impl<C> Redact for StateEvent<C>where
C: StateEventContent + RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
<C as RedactContent>::Redacted: StateEventContent,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey == <C as StateEventContent>::StateKey,
type Redacted = StateEvent<C>
type Redacted = StateEvent<C>
sourcefn redact(
self,
redaction: SyncRoomRedactionEvent,
version: &RoomVersionId
) -> StateEvent<C>
fn redact(
self,
redaction: SyncRoomRedactionEvent,
version: &RoomVersionId
) -> StateEvent<C>
self
into a redacted form (removing most fields) according to the spec. Read more