pub enum SyncStateEvent<C: StaticStateEventContent + RedactContent>where
C::Redacted: RedactedStateEventContent,{
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§
Source§impl<C> SyncStateEvent<C>where
C: StaticStateEventContent + RedactContent,
C::Redacted: RedactedStateEventContent + RedactedStateEventContent<StateKey = C::StateKey>,
impl<C> SyncStateEvent<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<&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).
Source§impl 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.
Source§impl 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.
Source§impl 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.
Sourcepub fn should_redact_events(&self) -> bool
pub fn should_redact_events(&self) -> bool
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>
impl SyncStateEvent<RoomPowerLevelsEventContent>
Sourcepub fn power_levels(
&self,
rules: &AuthorizationRules,
creators: Vec<OwnedUserId>,
) -> RoomPowerLevels
pub fn power_levels( &self, rules: &AuthorizationRules, creators: Vec<OwnedUserId>, ) -> RoomPowerLevels
Obtain the effective power levels, regardless of whether this event is redacted.
Trait Implementations§
Source§impl<C: Clone + StaticStateEventContent + RedactContent> Clone for SyncStateEvent<C>
impl<C: Clone + StaticStateEventContent + RedactContent> Clone for SyncStateEvent<C>
Source§fn clone(&self) -> SyncStateEvent<C>
fn clone(&self) -> SyncStateEvent<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 + StaticStateEventContent + RedactContent> Debug for SyncStateEvent<C>
impl<C: Debug + StaticStateEventContent + RedactContent> Debug for SyncStateEvent<C>
Source§impl<'de, C> Deserialize<'de> for SyncStateEvent<C>where
C: StaticStateEventContent + EventContentFromType + RedactContent,
C::Redacted: RedactedStateEventContent + EventContentFromType + RedactedStateEventContent<StateKey = C::StateKey>,
impl<'de, C> Deserialize<'de> for SyncStateEvent<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>,
Source§impl<C> From<StateEvent<C>> for SyncStateEvent<C>
impl<C> From<StateEvent<C>> for SyncStateEvent<C>
Source§fn from(full: StateEvent<C>) -> Self
fn from(full: StateEvent<C>) -> Self
Source§impl From<SyncStateEvent<BeaconInfoEventContent>> for AnySyncStateEvent
Available on crate feature unstable-msc3489 only.
impl From<SyncStateEvent<BeaconInfoEventContent>> for AnySyncStateEvent
unstable-msc3489 only.Source§fn from(c: SyncBeaconInfoEvent) -> Self
fn from(c: SyncBeaconInfoEvent) -> Self
Source§impl From<SyncStateEvent<CallMemberEventContent>> for AnySyncStateEvent
Available on crate feature unstable-msc3401 only.
impl From<SyncStateEvent<CallMemberEventContent>> for AnySyncStateEvent
unstable-msc3401 only.Source§fn from(c: SyncCallMemberEvent) -> Self
fn from(c: SyncCallMemberEvent) -> Self
Source§impl From<SyncStateEvent<MemberHintsEventContent>> for AnySyncStateEvent
Available on crate feature unstable-msc4171 only.
impl From<SyncStateEvent<MemberHintsEventContent>> for AnySyncStateEvent
unstable-msc4171 only.Source§fn from(c: SyncMemberHintsEvent) -> Self
fn from(c: SyncMemberHintsEvent) -> Self
Source§impl From<SyncStateEvent<PolicyRuleRoomEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<PolicyRuleRoomEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncPolicyRuleRoomEvent) -> Self
fn from(c: SyncPolicyRuleRoomEvent) -> Self
Source§impl From<SyncStateEvent<PolicyRuleServerEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<PolicyRuleServerEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncPolicyRuleServerEvent) -> Self
fn from(c: SyncPolicyRuleServerEvent) -> Self
Source§impl From<SyncStateEvent<PolicyRuleUserEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<PolicyRuleUserEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncPolicyRuleUserEvent) -> Self
fn from(c: SyncPolicyRuleUserEvent) -> Self
Source§impl From<SyncStateEvent<RoomAvatarEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomAvatarEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomAvatarEvent) -> Self
fn from(c: SyncRoomAvatarEvent) -> Self
Source§impl From<SyncStateEvent<RoomCanonicalAliasEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomCanonicalAliasEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomCanonicalAliasEvent) -> Self
fn from(c: SyncRoomCanonicalAliasEvent) -> Self
Source§impl From<SyncStateEvent<RoomCreateEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomCreateEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomCreateEvent) -> Self
fn from(c: SyncRoomCreateEvent) -> Self
Source§impl From<SyncStateEvent<RoomEncryptionEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomEncryptionEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomEncryptionEvent) -> Self
fn from(c: SyncRoomEncryptionEvent) -> Self
Source§impl From<SyncStateEvent<RoomGuestAccessEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomGuestAccessEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomGuestAccessEvent) -> Self
fn from(c: SyncRoomGuestAccessEvent) -> Self
Source§impl From<SyncStateEvent<RoomHistoryVisibilityEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomHistoryVisibilityEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomHistoryVisibilityEvent) -> Self
fn from(c: SyncRoomHistoryVisibilityEvent) -> Self
Source§impl From<SyncStateEvent<RoomImagePackEventContent>> for AnySyncStateEvent
Available on crate feature unstable-msc2545 only.
impl From<SyncStateEvent<RoomImagePackEventContent>> for AnySyncStateEvent
unstable-msc2545 only.Source§fn from(c: SyncRoomImagePackEvent) -> Self
fn from(c: SyncRoomImagePackEvent) -> Self
Source§impl From<SyncStateEvent<RoomJoinRulesEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomJoinRulesEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomJoinRulesEvent) -> Self
fn from(c: SyncRoomJoinRulesEvent) -> Self
Source§impl From<SyncStateEvent<RoomLanguageEventContent>> for AnySyncStateEvent
Available on crate feature unstable-msc4334 only.
impl From<SyncStateEvent<RoomLanguageEventContent>> for AnySyncStateEvent
unstable-msc4334 only.Source§fn from(c: SyncRoomLanguageEvent) -> Self
fn from(c: SyncRoomLanguageEvent) -> Self
Source§impl From<SyncStateEvent<RoomMemberEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomMemberEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomMemberEvent) -> Self
fn from(c: SyncRoomMemberEvent) -> Self
Source§impl From<SyncStateEvent<RoomNameEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomNameEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomNameEvent) -> Self
fn from(c: SyncRoomNameEvent) -> Self
Source§impl From<SyncStateEvent<RoomPinnedEventsEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomPinnedEventsEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomPinnedEventsEvent) -> Self
fn from(c: SyncRoomPinnedEventsEvent) -> Self
Source§impl From<SyncStateEvent<RoomPolicyEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomPolicyEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomPolicyEvent) -> Self
fn from(c: SyncRoomPolicyEvent) -> Self
Source§impl From<SyncStateEvent<RoomPowerLevelsEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomPowerLevelsEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomPowerLevelsEvent) -> Self
fn from(c: SyncRoomPowerLevelsEvent) -> Self
Source§impl From<SyncStateEvent<RoomServerAclEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomServerAclEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomServerAclEvent) -> Self
fn from(c: SyncRoomServerAclEvent) -> Self
Source§impl From<SyncStateEvent<RoomThirdPartyInviteEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomThirdPartyInviteEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomThirdPartyInviteEvent) -> Self
fn from(c: SyncRoomThirdPartyInviteEvent) -> Self
Source§impl From<SyncStateEvent<RoomTombstoneEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomTombstoneEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomTombstoneEvent) -> Self
fn from(c: SyncRoomTombstoneEvent) -> Self
Source§impl From<SyncStateEvent<RoomTopicEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<RoomTopicEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncRoomTopicEvent) -> Self
fn from(c: SyncRoomTopicEvent) -> Self
Source§impl From<SyncStateEvent<SpaceChildEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<SpaceChildEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncSpaceChildEvent) -> Self
fn from(c: SyncSpaceChildEvent) -> Self
Source§impl From<SyncStateEvent<SpaceParentEventContent>> for AnySyncStateEvent
impl From<SyncStateEvent<SpaceParentEventContent>> for AnySyncStateEvent
Source§fn from(c: SyncSpaceParentEvent) -> Self
fn from(c: SyncSpaceParentEvent) -> Self
Source§impl From<SyncStateEvent<StateRoomEncryptedEventContent>> for AnySyncStateEvent
Available on crate feature unstable-msc4362 only.
impl From<SyncStateEvent<StateRoomEncryptedEventContent>> for AnySyncStateEvent
unstable-msc4362 only.Source§fn from(c: SyncStateRoomEncryptedEvent) -> Self
fn from(c: SyncStateRoomEncryptedEvent) -> Self
impl<C: StaticStateEventContent + RedactContent> JsonCastable<AnySyncStateEvent> for SyncStateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<AnySyncTimelineEvent> for SyncStateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<Map<String, Value>> for SyncStateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<StrippedStateEvent<<C as StaticStateEventContent>::PossiblyRedacted>> for SyncStateEvent<C>
impl<C: StaticStateEventContent + RedactContent> JsonCastable<SyncStateEvent<C>> for OriginalStateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<SyncStateEvent<C>> for OriginalSyncStateEvent<C>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<SyncStateEvent<C>> for RedactedStateEvent<C::Redacted>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<SyncStateEvent<C>> for RedactedSyncStateEvent<C::Redacted>where
C::Redacted: RedactedStateEventContent,
impl<C: StaticStateEventContent + RedactContent> JsonCastable<SyncStateEvent<C>> for StateEvent<C>where
C::Redacted: RedactedStateEventContent,
Auto Trait Implementations§
impl<C> Freeze for SyncStateEvent<C>where
<C as RedactContent>::Redacted: Sized + Freeze,
C: Freeze,
<C as StateEventContent>::StateKey: Freeze,
<C as StaticStateEventContent>::Unsigned: Freeze,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Freeze,
impl<C> RefUnwindSafe for SyncStateEvent<C>where
<C as RedactContent>::Redacted: Sized + RefUnwindSafe,
C: RefUnwindSafe,
<C as StateEventContent>::StateKey: RefUnwindSafe,
<C as StaticStateEventContent>::Unsigned: RefUnwindSafe,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: RefUnwindSafe,
impl<C> Send for SyncStateEvent<C>where
<C as RedactContent>::Redacted: Sized + Send,
C: Send,
<C as StateEventContent>::StateKey: Send,
<C as StaticStateEventContent>::Unsigned: Send,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Send,
impl<C> Sync for SyncStateEvent<C>where
<C as RedactContent>::Redacted: Sized + Sync,
C: Sync,
<C as StateEventContent>::StateKey: Sync,
<C as StaticStateEventContent>::Unsigned: Sync,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Sync,
impl<C> Unpin for SyncStateEvent<C>where
<C as RedactContent>::Redacted: Sized + Unpin,
C: Unpin,
<C as StateEventContent>::StateKey: Unpin,
<C as StaticStateEventContent>::Unsigned: Unpin,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: Unpin,
impl<C> UnsafeUnpin for SyncStateEvent<C>where
<C as RedactContent>::Redacted: Sized + UnsafeUnpin,
C: UnsafeUnpin,
<C as StateEventContent>::StateKey: UnsafeUnpin,
<C as StaticStateEventContent>::Unsigned: UnsafeUnpin,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: UnsafeUnpin,
impl<C> UnwindSafe for SyncStateEvent<C>where
<C as RedactContent>::Redacted: Sized + UnwindSafe,
C: UnwindSafe,
<C as StateEventContent>::StateKey: UnwindSafe,
<C as StaticStateEventContent>::Unsigned: UnwindSafe,
<<C as RedactContent>::Redacted as RedactedStateEventContent>::StateKey: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more