#[non_exhaustive]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 (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.content: CData specific to the event type.
sender: OwnedUserIdThe fully-qualified ID of the user who sent this event.
state_key: C::StateKeyA unique key which defines the overwriting semantics for this piece of room state.
This must be a string type, and is often an empty string.
A state event is keyed by its (type, state_key) tuple. Sending another state event with
the same tuple replaces the previous one.
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,
rules: &AuthorizationRules,
creators: Vec<OwnedUserId>,
) -> RoomPowerLevels
pub fn power_levels( &self, rules: &AuthorizationRules, creators: Vec<OwnedUserId>, ) -> 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
Available on crate feature unstable-msc3401 only.
impl From<StrippedStateEvent<CallMemberEventContent>> for AnyStrippedStateEvent
unstable-msc3401 only.Source§fn from(c: StrippedCallMemberEvent) -> Self
fn from(c: StrippedCallMemberEvent) -> Self
Source§impl From<StrippedStateEvent<PossiblyRedactedBeaconInfoEventContent>> for AnyStrippedStateEvent
Available on crate feature unstable-msc3489 only.
impl From<StrippedStateEvent<PossiblyRedactedBeaconInfoEventContent>> for AnyStrippedStateEvent
unstable-msc3489 only.Source§fn from(c: StrippedBeaconInfoEvent) -> Self
fn from(c: StrippedBeaconInfoEvent) -> Self
Source§impl From<StrippedStateEvent<PossiblyRedactedMemberHintsEventContent>> for AnyStrippedStateEvent
Available on crate feature unstable-msc4171 only.
impl From<StrippedStateEvent<PossiblyRedactedMemberHintsEventContent>> for AnyStrippedStateEvent
unstable-msc4171 only.