Struct matrix_sdk_base::ruma::events::StrippedStateEvent
pub struct StrippedStateEvent<C>where
C: PossiblyRedactedStateEventContent,{
pub content: C,
pub sender: OwnedUserId,
pub state_key: <C as PossiblyRedactedStateEventContent>::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 as PossiblyRedactedStateEventContent>::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§
§impl StrippedStateEvent<RoomMemberEventContent>
impl StrippedStateEvent<RoomMemberEventContent>
pub 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.
pub 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.
§impl StrippedStateEvent<RoomPowerLevelsEventContent>
impl StrippedStateEvent<RoomPowerLevelsEventContent>
pub fn power_levels(&self) -> RoomPowerLevels
pub fn power_levels(&self) -> RoomPowerLevels
Obtain the effective power levels from this event.
Trait Implementations§
§impl<C> Clone for StrippedStateEvent<C>where
C: Clone + PossiblyRedactedStateEventContent,
<C as PossiblyRedactedStateEventContent>::StateKey: Clone,
impl<C> Clone for StrippedStateEvent<C>where
C: Clone + PossiblyRedactedStateEventContent,
<C as PossiblyRedactedStateEventContent>::StateKey: Clone,
§fn clone(&self) -> StrippedStateEvent<C>
fn clone(&self) -> StrippedStateEvent<C>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<C> Debug for StrippedStateEvent<C>where
C: Debug + PossiblyRedactedStateEventContent,
<C as PossiblyRedactedStateEventContent>::StateKey: Debug,
impl<C> Debug for StrippedStateEvent<C>where
C: Debug + PossiblyRedactedStateEventContent,
<C as PossiblyRedactedStateEventContent>::StateKey: Debug,
§impl<'de, C> Deserialize<'de> for StrippedStateEvent<C>
impl<'de, C> Deserialize<'de> for StrippedStateEvent<C>
§fn deserialize<D>(
deserializer: D
) -> Result<StrippedStateEvent<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<StrippedStateEvent<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§impl From<&StrippedStateEvent<PossiblyRedactedRoomGuestAccessEventContent>> for MinimalStateEvent<RoomGuestAccessEventContent>
impl From<&StrippedStateEvent<PossiblyRedactedRoomGuestAccessEventContent>> for MinimalStateEvent<RoomGuestAccessEventContent>
source§fn from(event: &StrippedRoomGuestAccessEvent) -> Self
fn from(event: &StrippedRoomGuestAccessEvent) -> Self
source§impl From<&StrippedStateEvent<PossiblyRedactedRoomNameEventContent>> for MinimalStateEvent<RoomNameEventContent>
impl From<&StrippedStateEvent<PossiblyRedactedRoomNameEventContent>> for MinimalStateEvent<RoomNameEventContent>
source§fn from(event: &StrippedRoomNameEvent) -> Self
fn from(event: &StrippedRoomNameEvent) -> Self
source§impl From<&StrippedStateEvent<PossiblyRedactedRoomTombstoneEventContent>> for MinimalStateEvent<RoomTombstoneEventContent>
impl From<&StrippedStateEvent<PossiblyRedactedRoomTombstoneEventContent>> for MinimalStateEvent<RoomTombstoneEventContent>
source§fn from(event: &StrippedRoomTombstoneEvent) -> Self
fn from(event: &StrippedRoomTombstoneEvent) -> Self
source§impl From<&StrippedStateEvent<PossiblyRedactedRoomTopicEventContent>> for MinimalStateEvent<RoomTopicEventContent>
impl From<&StrippedStateEvent<PossiblyRedactedRoomTopicEventContent>> for MinimalStateEvent<RoomTopicEventContent>
source§fn from(event: &StrippedRoomTopicEvent) -> Self
fn from(event: &StrippedRoomTopicEvent) -> Self
source§impl From<&StrippedStateEvent<RoomAvatarEventContent>> for MinimalStateEvent<RoomAvatarEventContent>
impl From<&StrippedStateEvent<RoomAvatarEventContent>> for MinimalStateEvent<RoomAvatarEventContent>
source§fn from(event: &StrippedRoomAvatarEvent) -> Self
fn from(event: &StrippedRoomAvatarEvent) -> Self
source§impl From<&StrippedStateEvent<RoomCanonicalAliasEventContent>> for MinimalStateEvent<RoomCanonicalAliasEventContent>
impl From<&StrippedStateEvent<RoomCanonicalAliasEventContent>> for MinimalStateEvent<RoomCanonicalAliasEventContent>
source§fn from(event: &StrippedRoomCanonicalAliasEvent) -> Self
fn from(event: &StrippedRoomCanonicalAliasEvent) -> Self
source§impl From<&StrippedStateEvent<RoomCreateEventContent>> for MinimalStateEvent<RoomCreateWithCreatorEventContent>
impl From<&StrippedStateEvent<RoomCreateEventContent>> for MinimalStateEvent<RoomCreateWithCreatorEventContent>
source§fn from(event: &StrippedRoomCreateEvent) -> Self
fn from(event: &StrippedRoomCreateEvent) -> Self
source§impl From<&StrippedStateEvent<RoomHistoryVisibilityEventContent>> for MinimalStateEvent<RoomHistoryVisibilityEventContent>
impl From<&StrippedStateEvent<RoomHistoryVisibilityEventContent>> for MinimalStateEvent<RoomHistoryVisibilityEventContent>
source§fn from(event: &StrippedRoomHistoryVisibilityEvent) -> Self
fn from(event: &StrippedRoomHistoryVisibilityEvent) -> Self
source§impl From<&StrippedStateEvent<RoomJoinRulesEventContent>> for MinimalStateEvent<RoomJoinRulesEventContent>
impl From<&StrippedStateEvent<RoomJoinRulesEventContent>> for MinimalStateEvent<RoomJoinRulesEventContent>
source§fn from(event: &StrippedRoomJoinRulesEvent) -> Self
fn from(event: &StrippedRoomJoinRulesEvent) -> Self
§impl From<StrippedStateEvent<PossiblyRedactedCallMemberEventContent>> for AnyStrippedStateEvent
Available on crate feature unstable-msc3401
only.
impl From<StrippedStateEvent<PossiblyRedactedCallMemberEventContent>> for AnyStrippedStateEvent
unstable-msc3401
only.