Struct ruma_common::events::StrippedStateEvent
source · [−]pub struct StrippedStateEvent<C: StateEventContent> {
pub content: C,
pub sender: OwnedUserId,
pub state_key: C::StateKey,
}
Expand description
A stripped-down state event, used for previews of rooms the user has been invited to.
Fields
content: C
Data specific to the event type.
sender: OwnedUserId
The fully-qualified ID of the user who sent this event.
state_key: C::StateKey
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.
Implementations
sourceimpl StrippedStateEvent<RoomMemberEventContent>
impl StrippedStateEvent<RoomMemberEventContent>
sourcepub fn details(&self) -> MembershipDetails<'_>
pub fn details(&self) -> MembershipDetails<'_>
Obtain the details about this event that are required to calculate a membership change.
This is required when you want to calculate the change a redacted m.room.member
event
made.
sourcepub fn membership_change<'a>(
&'a self,
prev_details: Option<MembershipDetails<'a>>
) -> MembershipChange<'a>
pub fn membership_change<'a>(
&'a self,
prev_details: Option<MembershipDetails<'a>>
) -> MembershipChange<'a>
Helper function for membership change.
Since stripped events don’t have unsigned.prev_content
, you have to pass the .details()
of the previous m.room.member
event manually (if there is a previous m.room.member
event).
Check the specification for details.
sourceimpl StrippedStateEvent<RoomPowerLevelsEventContent>
impl StrippedStateEvent<RoomPowerLevelsEventContent>
sourcepub fn power_levels(&self) -> RoomPowerLevels
pub fn power_levels(&self) -> RoomPowerLevels
Obtain the effective power levels from this event.
Trait Implementations
sourceimpl<C: Clone + StateEventContent> Clone for StrippedStateEvent<C> where
C::StateKey: Clone,
impl<C: Clone + StateEventContent> Clone for StrippedStateEvent<C> where
C::StateKey: Clone,
sourcefn clone(&self) -> StrippedStateEvent<C>
fn clone(&self) -> StrippedStateEvent<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 StrippedStateEvent<C> where
C::StateKey: Debug,
impl<C: Debug + StateEventContent> Debug for StrippedStateEvent<C> where
C::StateKey: Debug,
sourceimpl<'de, C: StateEventContent> Deserialize<'de> for StrippedStateEvent<C>
impl<'de, C: StateEventContent> Deserialize<'de> for StrippedStateEvent<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 From<StrippedStateEvent<PolicyRuleRoomEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PolicyRuleRoomEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedPolicyRuleRoomEvent) -> Self
fn from(c: StrippedPolicyRuleRoomEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<PolicyRuleServerEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PolicyRuleServerEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedPolicyRuleServerEvent) -> Self
fn from(c: StrippedPolicyRuleServerEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<PolicyRuleUserEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PolicyRuleUserEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedPolicyRuleUserEvent) -> Self
fn from(c: StrippedPolicyRuleUserEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomAliasesEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomAliasesEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomAliasesEvent) -> Self
fn from(c: StrippedRoomAliasesEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomAvatarEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomAvatarEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomAvatarEvent) -> Self
fn from(c: StrippedRoomAvatarEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomCanonicalAliasEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomCanonicalAliasEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomCanonicalAliasEvent) -> Self
fn from(c: StrippedRoomCanonicalAliasEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomCreateEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomCreateEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomCreateEvent) -> Self
fn from(c: StrippedRoomCreateEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomEncryptionEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomEncryptionEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomEncryptionEvent) -> Self
fn from(c: StrippedRoomEncryptionEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomGuestAccessEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomGuestAccessEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomGuestAccessEvent) -> Self
fn from(c: StrippedRoomGuestAccessEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomHistoryVisibilityEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomHistoryVisibilityEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomHistoryVisibilityEvent) -> Self
fn from(c: StrippedRoomHistoryVisibilityEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomJoinRulesEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomJoinRulesEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomJoinRulesEvent) -> Self
fn from(c: StrippedRoomJoinRulesEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomMemberEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomMemberEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomMemberEvent) -> Self
fn from(c: StrippedRoomMemberEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomNameEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomNameEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomNameEvent) -> Self
fn from(c: StrippedRoomNameEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomPinnedEventsEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomPinnedEventsEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomPinnedEventsEvent) -> Self
fn from(c: StrippedRoomPinnedEventsEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomPowerLevelsEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomPowerLevelsEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomPowerLevelsEvent) -> Self
fn from(c: StrippedRoomPowerLevelsEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomServerAclEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomServerAclEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomServerAclEvent) -> Self
fn from(c: StrippedRoomServerAclEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomThirdPartyInviteEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomThirdPartyInviteEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomThirdPartyInviteEvent) -> Self
fn from(c: StrippedRoomThirdPartyInviteEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomTombstoneEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomTombstoneEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomTombstoneEvent) -> Self
fn from(c: StrippedRoomTombstoneEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<RoomTopicEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomTopicEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedRoomTopicEvent) -> Self
fn from(c: StrippedRoomTopicEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<SpaceChildEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<SpaceChildEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedSpaceChildEvent) -> Self
fn from(c: StrippedSpaceChildEvent) -> Self
Converts to this type from the input type.
sourceimpl From<StrippedStateEvent<SpaceParentEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<SpaceParentEventContent>> for AnyStrippedStateEvent
sourcefn from(c: StrippedSpaceParentEvent) -> Self
fn from(c: StrippedSpaceParentEvent) -> Self
Converts to this type from the input type.
sourceimpl<C: StateEventContent> Serialize for StrippedStateEvent<C>
impl<C: StateEventContent> Serialize for StrippedStateEvent<C>
Auto Trait Implementations
impl<C> RefUnwindSafe for StrippedStateEvent<C> where
C: RefUnwindSafe,
<C as StateEventContent>::StateKey: RefUnwindSafe,
impl<C> Send for StrippedStateEvent<C> where
C: Send,
<C as StateEventContent>::StateKey: Send,
impl<C> Sync for StrippedStateEvent<C> where
C: Sync,
<C as StateEventContent>::StateKey: Sync,
impl<C> Unpin for StrippedStateEvent<C> where
C: Unpin,
<C as StateEventContent>::StateKey: Unpin,
impl<C> UnwindSafe for StrippedStateEvent<C> where
C: UnwindSafe,
<C 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