Struct ruma_events::SyncStateEvent
source · [−]pub struct SyncStateEvent<C: StateEventContent> {
pub content: C,
pub event_id: Box<EventId>,
pub sender: Box<UserId>,
pub origin_server_ts: MilliSecondsSinceUnixEpoch,
pub state_key: String,
pub prev_content: Option<C>,
pub unsigned: Unsigned,
}
Expand description
A 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
.
Fields
content: C
Data specific to the event type.
event_id: Box<EventId>
The globally unique event identifier for the user who sent the event.
sender: Box<UserId>
The fully-qualified ID of the user who sent this event.
origin_server_ts: MilliSecondsSinceUnixEpoch
Timestamp in milliseconds on originating homeserver when this event was sent.
state_key: String
A unique key which defines the overwriting semantics for this piece of room state.
This is often an empty string, but some events send a UserId
to show which user the event
affects.
prev_content: Option<C>
Optional previous content for this event.
unsigned: Unsigned
Additional key-value pairs not signed by the homeserver.
Implementations
sourceimpl<C: StateEventContent> SyncStateEvent<C>
impl<C: StateEventContent> SyncStateEvent<C>
sourcepub fn into_full_event(self, room_id: Box<RoomId>) -> StateEvent<C>
pub fn into_full_event(self, room_id: Box<RoomId>) -> StateEvent<C>
Convert this sync event into a full event, one with a room_id field.
sourceimpl SyncStateEvent<RoomMemberEventContent>
impl SyncStateEvent<RoomMemberEventContent>
sourcepub fn membership_change(&self) -> MembershipChange
pub fn membership_change(&self) -> MembershipChange
Helper function for membership change.
Check the specification for details.
Trait Implementations
sourceimpl<C: Clone + StateEventContent> Clone for SyncStateEvent<C>
impl<C: Clone + StateEventContent> Clone for SyncStateEvent<C>
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> Debug for SyncStateEvent<C>
impl<C: Debug + StateEventContent> Debug for SyncStateEvent<C>
sourceimpl<'de, C: StateEventContent> Deserialize<'de> for SyncStateEvent<C>
impl<'de, C: StateEventContent> Deserialize<'de> for SyncStateEvent<C>
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: StateEventContent> From<StateEvent<C>> for SyncStateEvent<C>
impl<C: StateEventContent> From<StateEvent<C>> for SyncStateEvent<C>
sourcefn from(event: StateEvent<C>) -> Self
fn from(event: 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: StateEventContent> Ord for SyncStateEvent<C>
impl<C: StateEventContent> Ord for SyncStateEvent<C>
sourceimpl<C: StateEventContent> PartialEq<SyncStateEvent<C>> for SyncStateEvent<C>
impl<C: StateEventContent> PartialEq<SyncStateEvent<C>> for SyncStateEvent<C>
sourceimpl<C: StateEventContent> PartialOrd<SyncStateEvent<C>> for SyncStateEvent<C>
impl<C: StateEventContent> PartialOrd<SyncStateEvent<C>> for SyncStateEvent<C>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
Compares EventId
s and orders them lexicographically.
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<C: StateEventContent> Redact for SyncStateEvent<C> where
C: RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
impl<C: StateEventContent> Redact for SyncStateEvent<C> where
C: RedactContent,
<C as RedactContent>::Redacted: RedactedStateEventContent,
type Redacted = RedactedSyncStateEvent<<C as RedactContent>::Redacted>
type Redacted = RedactedSyncStateEvent<<C as RedactContent>::Redacted>
The redacted form of the event.
sourcefn redact(
self,
redaction: SyncRoomRedactionEvent,
version: &RoomVersionId
) -> Self::Redacted
fn redact(
self,
redaction: SyncRoomRedactionEvent,
version: &RoomVersionId
) -> Self::Redacted
Transforms self
into a redacted form (removing most fields) according to the spec. Read more
sourceimpl<C: StateEventContent> Serialize for SyncStateEvent<C>
impl<C: StateEventContent> Serialize for SyncStateEvent<C>
impl<C: StateEventContent> Eq for SyncStateEvent<C>
Auto Trait Implementations
impl<C> RefUnwindSafe for SyncStateEvent<C> where
C: RefUnwindSafe,
impl<C> Send for SyncStateEvent<C> where
C: Send,
impl<C> Sync for SyncStateEvent<C> where
C: Sync,
impl<C> Unpin for SyncStateEvent<C> where
C: Unpin,
impl<C> UnwindSafe for SyncStateEvent<C> where
C: 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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
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