Enum ruma_common::events::SyncStateEvent
source · [−]pub enum SyncStateEvent<C: StateEventContent + RedactContent> where
C::Redacted: StateEventContent + RedactedEventContent, {
Original(OriginalSyncStateEvent<C>),
Redacted(RedactedSyncStateEvent<C::Redacted>),
}
Expand description
A possibly-redacted state event without a room_id
.
SyncStateEvent
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(OriginalSyncStateEvent<C>)
Original, unredacted form of the event.
Redacted(RedactedSyncStateEvent<C::Redacted>)
Redacted form of the event with minimal fields.
Implementations
sourceimpl<C> SyncStateEvent<C> where
C: StateEventContent + RedactContent,
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: StateEventContent<StateKey = C::StateKey>,
impl<C> SyncStateEvent<C> where
C: StateEventContent + RedactContent,
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: StateEventContent<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<&OriginalSyncStateEvent<C>>
pub fn as_original(&self) -> Option<&OriginalSyncStateEvent<C>>
Get the inner OriginalSyncStateEvent
if this is an unredacted event.
sourcepub fn into_full_event(self, room_id: OwnedRoomId) -> StateEvent<C>
pub fn into_full_event(self, room_id: OwnedRoomId) -> StateEvent<C>
Convert this sync event into a full event (one with a room_id
field).
sourceimpl SyncStateEvent<RoomGuestAccessEventContent>
impl SyncStateEvent<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 SyncStateEvent<RoomHistoryVisibilityEventContent>
impl SyncStateEvent<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 SyncStateEvent<RoomMemberEventContent>
impl SyncStateEvent<RoomMemberEventContent>
sourcepub fn membership(&self) -> &MembershipState
pub fn membership(&self) -> &MembershipState
Obtain the membership state, regardless of whether this event is redacted.
sourceimpl SyncStateEvent<RoomPowerLevelsEventContent>
impl SyncStateEvent<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 + StateEventContent + RedactContent> Clone for SyncStateEvent<C> where
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: Clone,
impl<C: Clone + StateEventContent + RedactContent> Clone for SyncStateEvent<C> where
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: Clone,
sourcefn clone(&self) -> SyncStateEvent<C>
fn clone(&self) -> SyncStateEvent<C>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<C: Debug + StateEventContent + RedactContent> Debug for SyncStateEvent<C> where
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: Debug,
impl<C: Debug + StateEventContent + RedactContent> Debug for SyncStateEvent<C> where
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: Debug,
sourceimpl<'de, C> Deserialize<'de> for SyncStateEvent<C> where
C: StateEventContent + RedactContent,
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: StateEventContent<StateKey = C::StateKey>,
impl<'de, C> Deserialize<'de> for SyncStateEvent<C> where
C: StateEventContent + RedactContent,
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: StateEventContent<StateKey = C::StateKey>,
sourcefn 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
sourceimpl<C> From<StateEvent<C>> for SyncStateEvent<C> where
C: StateEventContent + RedactContent,
C::Redacted: StateEventContent + RedactedEventContent,
impl<C> From<StateEvent<C>> for SyncStateEvent<C> where
C: StateEventContent + RedactContent,
C::Redacted: StateEventContent + RedactedEventContent,
sourcefn from(full: StateEvent<C>) -> Self
fn from(full: StateEvent<C>) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<PolicyRuleRoomEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<PolicyRuleRoomEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncPolicyRuleRoomEvent) -> Self
fn from(c: SyncPolicyRuleRoomEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<PolicyRuleServerEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<PolicyRuleServerEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncPolicyRuleServerEvent) -> Self
fn from(c: SyncPolicyRuleServerEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<PolicyRuleUserEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<PolicyRuleUserEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncPolicyRuleUserEvent) -> Self
fn from(c: SyncPolicyRuleUserEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomAliasesEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomAliasesEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomAliasesEvent) -> Self
fn from(c: SyncRoomAliasesEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomAvatarEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomAvatarEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomAvatarEvent) -> Self
fn from(c: SyncRoomAvatarEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomCanonicalAliasEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomCanonicalAliasEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomCanonicalAliasEvent) -> Self
fn from(c: SyncRoomCanonicalAliasEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomCreateEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomCreateEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomCreateEvent) -> Self
fn from(c: SyncRoomCreateEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomEncryptionEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomEncryptionEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomEncryptionEvent) -> Self
fn from(c: SyncRoomEncryptionEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomGuestAccessEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomGuestAccessEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomGuestAccessEvent) -> Self
fn from(c: SyncRoomGuestAccessEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomHistoryVisibilityEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomHistoryVisibilityEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomHistoryVisibilityEvent) -> Self
fn from(c: SyncRoomHistoryVisibilityEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomJoinRulesEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomJoinRulesEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomJoinRulesEvent) -> Self
fn from(c: SyncRoomJoinRulesEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomMemberEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomMemberEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomMemberEvent) -> Self
fn from(c: SyncRoomMemberEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomNameEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomNameEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomNameEvent) -> Self
fn from(c: SyncRoomNameEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomPinnedEventsEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomPinnedEventsEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomPinnedEventsEvent) -> Self
fn from(c: SyncRoomPinnedEventsEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomPowerLevelsEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomPowerLevelsEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomPowerLevelsEvent) -> Self
fn from(c: SyncRoomPowerLevelsEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomServerAclEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomServerAclEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomServerAclEvent) -> Self
fn from(c: SyncRoomServerAclEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomThirdPartyInviteEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomThirdPartyInviteEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomThirdPartyInviteEvent) -> Self
fn from(c: SyncRoomThirdPartyInviteEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomTombstoneEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomTombstoneEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomTombstoneEvent) -> Self
fn from(c: SyncRoomTombstoneEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<RoomTopicEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomTopicEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncRoomTopicEvent) -> Self
fn from(c: SyncRoomTopicEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<SpaceChildEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<SpaceChildEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncSpaceChildEvent) -> Self
fn from(c: SyncSpaceChildEvent) -> Self
Converts to this type from the input type.
sourceimpl From<SyncStateEvent<SpaceParentEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<SpaceParentEventContent>> for AnySyncStateEvent
sourcefn from(c: SyncSpaceParentEvent) -> Self
fn from(c: SyncSpaceParentEvent) -> Self
Converts to this type from the input type.
sourceimpl<C> Redact for SyncStateEvent<C> where
C: StateEventContent + RedactContent,
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: StateEventContent<StateKey = C::StateKey>,
impl<C> Redact for SyncStateEvent<C> where
C: StateEventContent + RedactContent,
C::Redacted: StateEventContent + RedactedEventContent,
C::Redacted: StateEventContent<StateKey = C::StateKey>,
type Redacted = SyncStateEvent<C>
type Redacted = SyncStateEvent<C>
The redacted form of the event.
sourcefn redact(
self,
redaction: SyncRoomRedactionEvent,
version: &RoomVersionId
) -> Self
fn redact(
self,
redaction: SyncRoomRedactionEvent,
version: &RoomVersionId
) -> Self
Transforms self
into a redacted form (removing most fields) according to the spec. Read more
sourceimpl<C: StateEventContent + RedactContent> Serialize for SyncStateEvent<C> where
C::Redacted: StateEventContent + RedactedEventContent,
C: Serialize,
impl<C: StateEventContent + RedactContent> Serialize for SyncStateEvent<C> where
C::Redacted: StateEventContent + RedactedEventContent,
C: Serialize,
Auto Trait Implementations
impl<C> RefUnwindSafe for SyncStateEvent<C> where
C: RefUnwindSafe,
<C as RedactContent>::Redacted: RefUnwindSafe,
<C as StateEventContent>::StateKey: RefUnwindSafe,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey: RefUnwindSafe,
impl<C> Send for SyncStateEvent<C> where
C: Send,
<C as RedactContent>::Redacted: Send,
<C as StateEventContent>::StateKey: Send,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey: Send,
impl<C> Sync for SyncStateEvent<C> where
C: Sync,
<C as RedactContent>::Redacted: Sync,
<C as StateEventContent>::StateKey: Sync,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey: Sync,
impl<C> Unpin for SyncStateEvent<C> where
C: Unpin,
<C as RedactContent>::Redacted: Unpin,
<C as StateEventContent>::StateKey: Unpin,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey: Unpin,
impl<C> UnwindSafe for SyncStateEvent<C> where
C: UnwindSafe,
<C as RedactContent>::Redacted: UnwindSafe,
<C as StateEventContent>::StateKey: UnwindSafe,
<<C as RedactContent>::Redacted as StateEventContent>::StateKey: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more