Skip to main content

SyncStateEvent

Enum SyncStateEvent 

Source
pub enum SyncStateEvent<C>{
    Original(OriginalSyncStateEvent<C>),
    Redacted(RedactedSyncStateEvent<<C as RedactContent>::Redacted>),
}
Available on crate feature events only.
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 as RedactContent>::Redacted>)

Redacted form of the event with minimal fields.

Implementations§

Source§

impl<C> SyncStateEvent<C>

Source

pub fn event_type(&self) -> StateEventType

Available on crate feature unstable-msc3489 only.

Returns the type of this event.

Source

pub fn event_id(&self) -> &EventId

Available on crate feature unstable-msc3489 only.

Returns this event’s event_id field.

Source

pub fn sender(&self) -> &UserId

Available on crate feature unstable-msc3489 only.

Returns this event’s sender field.

Source

pub fn origin_server_ts(&self) -> MilliSecondsSinceUnixEpoch

Available on crate feature unstable-msc3489 only.

Returns this event’s origin_server_ts field.

Source

pub fn state_key(&self) -> &<C as StateEventContent>::StateKey

Available on crate feature unstable-msc3489 only.

Returns this event’s state_key field.

Source

pub fn as_original(&self) -> Option<&OriginalSyncStateEvent<C>>

Available on crate feature unstable-msc3489 only.

Get the inner OriginalSyncStateEvent if this is an unredacted event.

Source

pub fn into_full_event(self, room_id: OwnedRoomId) -> StateEvent<C>

Available on crate feature unstable-msc3489 only.

Convert this sync event into a full event (one with a room_id field).

Source§

impl SyncStateEvent<RoomGuestAccessEventContent>

Source

pub fn guest_access(&self) -> &GuestAccess

Available on crate feature unstable-msc3489 only.

Obtain the guest access policy, regardless of whether this event is redacted.

Source§

impl SyncStateEvent<RoomHistoryVisibilityEventContent>

Source

pub fn history_visibility(&self) -> &HistoryVisibility

Available on crate feature unstable-msc3489 only.

Obtain the history visibility, regardless of whether this event is redacted.

Source§

impl SyncStateEvent<RoomJoinRulesEventContent>

Source

pub fn join_rule(&self) -> &JoinRule

Available on crate feature unstable-msc3489 only.

Obtain the join rule, regardless of whether this event is redacted.

Source§

impl SyncStateEvent<RoomMemberEventContent>

Source

pub fn membership(&self) -> &MembershipState

Available on crate feature unstable-msc3489 only.

Obtain the membership state, regardless of whether this event is redacted.

Source

pub fn should_redact_events(&self) -> bool

Available on crate features unstable-msc3489 and unstable-msc4293 only.

Determines whether the user’s events should be redacted based on their membership.

Using MSC4293, if redact_events is true, the sender is different to the state key, and the membership is ban or leave (kick), true is returned. Otherwise, the flag should be ignored, and false is returned.

Source§

impl SyncStateEvent<RoomPowerLevelsEventContent>

Source

pub fn power_levels( &self, rules: &AuthorizationRules, creators: Vec<OwnedUserId>, ) -> RoomPowerLevels

Available on crate feature unstable-msc3489 only.

Obtain the effective power levels, regardless of whether this event is redacted.

Trait Implementations§

Source§

impl<C> Clone for SyncStateEvent<C>

Source§

fn clone(&self) -> SyncStateEvent<C>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C> Debug for SyncStateEvent<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de, C> Deserialize<'de> for SyncStateEvent<C>

Source§

fn deserialize<D>( deserializer: D, ) -> Result<SyncStateEvent<C>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<C> From<StateEvent<C>> for SyncStateEvent<C>

Source§

fn from(full: StateEvent<C>) -> SyncStateEvent<C>

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<BeaconInfoEventContent>> for AnySyncStateEvent

Available on crate feature unstable-msc3489 only.
Source§

fn from(c: SyncStateEvent<BeaconInfoEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<CallMemberEventContent>> for AnySyncStateEvent

Available on crate feature unstable-msc3401 only.
Source§

fn from(c: SyncStateEvent<CallMemberEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<MemberHintsEventContent>> for AnySyncStateEvent

Available on crate feature unstable-msc4171 only.
Source§

fn from(c: SyncStateEvent<MemberHintsEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<PolicyRuleRoomEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<PolicyRuleRoomEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<PolicyRuleServerEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<PolicyRuleServerEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<PolicyRuleUserEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<PolicyRuleUserEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomAvatarEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomAvatarEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomCanonicalAliasEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomCanonicalAliasEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomCreateEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomCreateEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomEncryptionEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomEncryptionEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomGuestAccessEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomGuestAccessEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomHistoryVisibilityEventContent>> for AnySyncStateEvent

Source§

fn from( c: SyncStateEvent<RoomHistoryVisibilityEventContent>, ) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomImagePackEventContent>> for AnySyncStateEvent

Available on crate feature unstable-msc2545 only.
Source§

fn from(c: SyncStateEvent<RoomImagePackEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomJoinRulesEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomJoinRulesEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomLanguageEventContent>> for AnySyncStateEvent

Available on crate feature unstable-msc4334 only.
Source§

fn from(c: SyncStateEvent<RoomLanguageEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomMemberEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomMemberEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomNameEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomNameEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomPinnedEventsEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomPinnedEventsEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomPolicyEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomPolicyEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomPowerLevelsEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomPowerLevelsEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomServerAclEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomServerAclEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomThirdPartyInviteEventContent>> for AnySyncStateEvent

Source§

fn from( c: SyncStateEvent<RoomThirdPartyInviteEventContent>, ) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomTombstoneEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomTombstoneEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<RoomTopicEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<RoomTopicEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<SpaceChildEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<SpaceChildEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<SpaceParentEventContent>> for AnySyncStateEvent

Source§

fn from(c: SyncStateEvent<SpaceParentEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl From<SyncStateEvent<StateRoomEncryptedEventContent>> for AnySyncStateEvent

Available on crate feature unstable-msc4362 only.
Source§

fn from(c: SyncStateEvent<StateRoomEncryptedEventContent>) -> AnySyncStateEvent

Converts to this type from the input type.
Source§

impl SpaceChildOrd for SyncStateEvent<SpaceChildEventContent>

Source§

fn cmp_space_child(&self, other: &impl SpaceChildOrd) -> Ordering

Return an Ordering between self and other, using the algorithm for ordering children within a space.
Source§

impl<C> JsonCastable<AnySyncStateEvent> for SyncStateEvent<C>

Source§

impl<C> JsonCastable<AnySyncTimelineEvent> for SyncStateEvent<C>

Source§

impl JsonCastable<HierarchySpaceChildEvent> for SyncStateEvent<SpaceChildEventContent>

Source§

impl<C> JsonCastable<Map<String, Value>> for SyncStateEvent<C>

Source§

impl<C> JsonCastable<StrippedStateEvent<<C as StaticStateEventContent>::PossiblyRedacted>> for SyncStateEvent<C>

Source§

impl<C> JsonCastable<SyncStateEvent<C>> for OriginalStateEvent<C>

Source§

impl<C> JsonCastable<SyncStateEvent<C>> for OriginalSyncStateEvent<C>

Source§

impl<C> JsonCastable<SyncStateEvent<C>> for RedactedStateEvent<<C as RedactContent>::Redacted>

Source§

impl<C> JsonCastable<SyncStateEvent<C>> for RedactedSyncStateEvent<<C as RedactContent>::Redacted>

Source§

impl<C> JsonCastable<SyncStateEvent<C>> for StateEvent<C>

Source§

impl RedactionEvent for SyncStateEvent<RoomMemberEventContent>

Available on crate feature unstable-msc4293 only.

Auto Trait Implementations§

§

impl<C> Freeze for SyncStateEvent<C>

§

impl<C> RefUnwindSafe for SyncStateEvent<C>

§

impl<C> Send for SyncStateEvent<C>

§

impl<C> Sync for SyncStateEvent<C>

§

impl<C> Unpin for SyncStateEvent<C>

§

impl<C> UnsafeUnpin for SyncStateEvent<C>

§

impl<C> UnwindSafe for SyncStateEvent<C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DropFlavorWrapper<T> for T

Source§

type Flavor = MayDrop

The DropFlavor that wraps T into Self
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> JsonCastable<BTreeMap<String, CanonicalJsonValue>> for T

Source§

impl<T> JsonCastable<CanonicalJsonValue> for T

Source§

impl<T> JsonCastable<Value> for T