Enum ruma::events::StateEvent
source · 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-msc3401
only.
pub fn event_type(&self) -> StateEventType
unstable-msc3401
only.Returns the type
of this event.
sourcepub fn event_id(&self) -> &EventId
Available on crate feature unstable-msc3401
only.
pub fn event_id(&self) -> &EventId
unstable-msc3401
only.Returns this event’s event_id
field.
sourcepub fn sender(&self) -> &UserId
Available on crate feature unstable-msc3401
only.
pub fn sender(&self) -> &UserId
unstable-msc3401
only.Returns this event’s sender
field.
sourcepub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
Available on crate feature unstable-msc3401
only.
pub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch
unstable-msc3401
only.Returns this event’s origin_server_ts
field.
sourcepub fn room_id(&self) -> &RoomId
Available on crate feature unstable-msc3401
only.
pub fn room_id(&self) -> &RoomId
unstable-msc3401
only.Returns this event’s room_id
field.
sourcepub fn state_key(&self) -> &<C as StateEventContent>::StateKey
Available on crate feature unstable-msc3401
only.
pub fn state_key(&self) -> &<C as StateEventContent>::StateKey
unstable-msc3401
only.Returns this event’s state_key
field.
sourcepub fn as_original(&self) -> Option<&OriginalStateEvent<C>>
Available on crate feature unstable-msc3401
only.
pub fn as_original(&self) -> Option<&OriginalStateEvent<C>>
unstable-msc3401
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-msc3401
only.
pub fn guest_access(&self) -> &GuestAccess
unstable-msc3401
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-msc3401
only.
pub fn history_visibility(&self) -> &HistoryVisibility
unstable-msc3401
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-msc3401
only.
pub fn membership(&self) -> &MembershipState
unstable-msc3401
only.Obtain the membership state, regardless of whether this event is redacted.
source§impl StateEvent<RoomPowerLevelsEventContent>
impl StateEvent<RoomPowerLevelsEventContent>
sourcepub fn power_levels(&self) -> RoomPowerLevels
Available on crate feature unstable-msc3401
only.
pub fn power_levels(&self) -> RoomPowerLevels
unstable-msc3401
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<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.