Struct ruma_events::StrippedStateEvent
source · pub struct StrippedStateEvent<C: PossiblyRedactedStateEventContent> {
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§
source§impl 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.
source§impl 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§
source§impl<C: Clone + PossiblyRedactedStateEventContent> Clone for StrippedStateEvent<C>
impl<C: Clone + PossiblyRedactedStateEventContent> Clone for StrippedStateEvent<C>
source§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 moresource§impl<C: Debug + PossiblyRedactedStateEventContent> Debug for StrippedStateEvent<C>
impl<C: Debug + PossiblyRedactedStateEventContent> Debug for StrippedStateEvent<C>
source§impl<'de, C> Deserialize<'de> for StrippedStateEvent<C>
impl<'de, C> Deserialize<'de> for StrippedStateEvent<C>
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 From<StrippedStateEvent<CallMemberEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<CallMemberEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedCallMemberEvent) -> Self
fn from(c: StrippedCallMemberEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedBeaconInfoEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedBeaconInfoEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedBeaconInfoEvent) -> Self
fn from(c: StrippedBeaconInfoEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedPolicyRuleRoomEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedPolicyRuleRoomEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedPolicyRuleRoomEvent) -> Self
fn from(c: StrippedPolicyRuleRoomEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedPolicyRuleServerEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedPolicyRuleServerEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedPolicyRuleServerEvent) -> Self
fn from(c: StrippedPolicyRuleServerEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedPolicyRuleUserEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedPolicyRuleUserEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedPolicyRuleUserEvent) -> Self
fn from(c: StrippedPolicyRuleUserEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedRoomAliasesEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedRoomAliasesEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomAliasesEvent) -> Self
fn from(c: StrippedRoomAliasesEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedRoomEncryptionEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedRoomEncryptionEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomEncryptionEvent) -> Self
fn from(c: StrippedRoomEncryptionEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedRoomGuestAccessEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedRoomGuestAccessEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomGuestAccessEvent) -> Self
fn from(c: StrippedRoomGuestAccessEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedRoomNameEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedRoomNameEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomNameEvent) -> Self
fn from(c: StrippedRoomNameEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedRoomPinnedEventsEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedRoomPinnedEventsEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomPinnedEventsEvent) -> Self
fn from(c: StrippedRoomPinnedEventsEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedRoomTombstoneEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedRoomTombstoneEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomTombstoneEvent) -> Self
fn from(c: StrippedRoomTombstoneEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedRoomTopicEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedRoomTopicEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomTopicEvent) -> Self
fn from(c: StrippedRoomTopicEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedSpaceChildEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedSpaceChildEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedSpaceChildEvent) -> Self
fn from(c: StrippedSpaceChildEvent) -> Self
source§impl From<StrippedStateEvent<PossiblyRedactedSpaceParentEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedSpaceParentEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedSpaceParentEvent) -> Self
fn from(c: StrippedSpaceParentEvent) -> Self
source§impl From<StrippedStateEvent<RoomAvatarEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomAvatarEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomAvatarEvent) -> Self
fn from(c: StrippedRoomAvatarEvent) -> Self
source§impl From<StrippedStateEvent<RoomCanonicalAliasEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomCanonicalAliasEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomCanonicalAliasEvent) -> Self
fn from(c: StrippedRoomCanonicalAliasEvent) -> Self
source§impl From<StrippedStateEvent<RoomCreateEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomCreateEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomCreateEvent) -> Self
fn from(c: StrippedRoomCreateEvent) -> Self
source§impl From<StrippedStateEvent<RoomHistoryVisibilityEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomHistoryVisibilityEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomHistoryVisibilityEvent) -> Self
fn from(c: StrippedRoomHistoryVisibilityEvent) -> Self
source§impl From<StrippedStateEvent<RoomJoinRulesEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomJoinRulesEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomJoinRulesEvent) -> Self
fn from(c: StrippedRoomJoinRulesEvent) -> Self
source§impl From<StrippedStateEvent<RoomMemberEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomMemberEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomMemberEvent) -> Self
fn from(c: StrippedRoomMemberEvent) -> Self
source§impl From<StrippedStateEvent<RoomPowerLevelsEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomPowerLevelsEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomPowerLevelsEvent) -> Self
fn from(c: StrippedRoomPowerLevelsEvent) -> Self
source§impl From<StrippedStateEvent<RoomServerAclEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomServerAclEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomServerAclEvent) -> Self
fn from(c: StrippedRoomServerAclEvent) -> Self
source§impl From<StrippedStateEvent<RoomThirdPartyInviteEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<RoomThirdPartyInviteEventContent>> for AnyStrippedStateEvent
source§fn from(c: StrippedRoomThirdPartyInviteEvent) -> Self
fn from(c: StrippedRoomThirdPartyInviteEvent) -> Self
Auto Trait Implementations§
impl<C> Freeze for StrippedStateEvent<C>
impl<C> RefUnwindSafe for StrippedStateEvent<C>
impl<C> Send for StrippedStateEvent<C>
impl<C> Sync for StrippedStateEvent<C>
impl<C> Unpin for StrippedStateEvent<C>
impl<C> UnwindSafe for StrippedStateEvent<C>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)