#[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<C: PossiblyRedactedStateEventContent> StrippedStateEvent<C>
impl<C: PossiblyRedactedStateEventContent> StrippedStateEvent<C>
Sourcepub fn event_type(&self) -> StateEventType
pub fn event_type(&self) -> StateEventType
Get the event’s type.
Source§impl StrippedStateEvent<PossiblyRedactedRoomMemberEventContent>
impl StrippedStateEvent<PossiblyRedactedRoomMemberEventContent>
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.
Sourcepub fn should_redact_events(&self) -> bool
pub fn should_redact_events(&self) -> bool
Determines whether the user’s events should be redacted based on their membership.
Using MSC4293, if redact_events is true, the sender is different to the state key,
and the membership is ban or leave (kick), true is returned. Otherwise, the flag
should be ignored, and false is returned.
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<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<PossiblyRedactedRoomMemberEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedRoomMemberEventContent>> for AnyStrippedStateEvent
Source§fn from(c: StrippedRoomMemberEvent) -> Self
fn from(c: StrippedRoomMemberEvent) -> 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<PossiblyRedactedRoomPolicyEventContent>> for AnyStrippedStateEvent
impl From<StrippedStateEvent<PossiblyRedactedRoomPolicyEventContent>> for AnyStrippedStateEvent
Source§fn from(c: StrippedRoomPolicyEvent) -> Self
fn from(c: StrippedRoomPolicyEvent) -> 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-msc4362 only.
impl From<StrippedStateEvent<PossiblyRedactedStateRoomEncryptedEventContent>> for AnyStrippedStateEvent
unstable-msc4362 only.Source§fn from(c: StrippedStateRoomEncryptedEvent) -> Self
fn from(c: StrippedStateRoomEncryptedEvent) -> 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<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
impl<C: PossiblyRedactedStateEventContent> JsonCastable<AnyStrippedStateEvent> for StrippedStateEvent<C>
impl<C: PossiblyRedactedStateEventContent> JsonCastable<Map<String, Value>> for StrippedStateEvent<C>
impl<C: StaticStateEventContent> JsonCastable<StrippedStateEvent<<C as StaticStateEventContent>::PossiblyRedacted>> for OriginalStateEvent<C>
impl<C: StaticStateEventContent> JsonCastable<StrippedStateEvent<<C as StaticStateEventContent>::PossiblyRedacted>> for OriginalSyncStateEvent<C>
impl<C: StaticStateEventContent + RedactContent> JsonCastable<StrippedStateEvent<<C as StaticStateEventContent>::PossiblyRedacted>> for StateEvent<C>
impl<C: StaticStateEventContent + RedactContent> JsonCastable<StrippedStateEvent<<C as StaticStateEventContent>::PossiblyRedacted>> for SyncStateEvent<C>
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> UnsafeUnpin 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§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more