#[non_exhaustive]pub struct StrippedStateEvent<C: PossiblyRedactedStateEventContent> {
pub content: C,
pub sender: OwnedUserId,
pub state_key: C::StateKey,
pub origin_server_ts: Option<MilliSecondsSinceUnixEpoch>,
pub unsigned: Option<Raw<StateUnsigned<C>>>,
}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.
origin_server_ts: Option<MilliSecondsSinceUnixEpoch>Timestamp on the originating homeserver when this event was sent.
This field is usually stripped, but some events might include it.
unsigned: Option<Raw<StateUnsigned<C>>>Additional key-value pairs not signed by the homeserver.
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.Source§fn from(c: StrippedMemberHintsEvent) -> Self
fn from(c: StrippedMemberHintsEvent) -> 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<PossiblyRedactedRoomImagePackEventContent>> for AnyStrippedStateEvent
Available on crate feature unstable-msc2545 only.
impl From<StrippedStateEvent<PossiblyRedactedRoomImagePackEventContent>> for AnyStrippedStateEvent
unstable-msc2545 only.Source§fn from(c: StrippedRoomImagePackEvent) -> Self
fn from(c: StrippedRoomImagePackEvent) -> Self
Source§impl From<StrippedStateEvent<PossiblyRedactedRoomLanguageEventContent>> for AnyStrippedStateEvent
Available on crate feature unstable-msc4334 only.
impl From<StrippedStateEvent<PossiblyRedactedRoomLanguageEventContent>> for AnyStrippedStateEvent
unstable-msc4334 only.Source§fn from(c: StrippedRoomLanguageEvent) -> Self
fn from(c: StrippedRoomLanguageEvent) -> 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<PossiblyRedactedStateRoomEncryptedEventContent>> for AnyStrippedStateEvent
Available on crate feature unstable-msc3414 only.
impl From<StrippedStateEvent<PossiblyRedactedStateRoomEncryptedEventContent>> for AnyStrippedStateEvent
unstable-msc3414 only.