Struct PossiblyRedactedRoomMemberEventContent
#[non_exhaustive]pub struct PossiblyRedactedRoomMemberEventContent {
pub avatar_url: Option<OwnedMxcUri>,
pub displayname: Option<String>,
pub is_direct: Option<bool>,
pub membership: MembershipState,
pub third_party_invite: Option<PossiblyRedactedThirdPartyInvite>,
pub blurhash: Option<String>,
pub reason: Option<String>,
pub join_authorized_via_users_server: Option<OwnedUserId>,
}Expand description
The possibly redacted form of RoomMemberEventContent.
This type is used when it’s not obvious whether the content is redacted or not.
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.avatar_url: Option<OwnedMxcUri>The avatar URL for this user, if any.
This is added by the homeserver. If you activate the compat-empty-string-null feature,
this field being an empty string in JSON will result in None here during deserialization.
displayname: Option<String>The display name for this user, if any.
This is added by the homeserver.
is_direct: Option<bool>Flag indicating whether the room containing this event was created with the intention of being a direct chat.
membership: MembershipStateThe membership state of this user.
third_party_invite: Option<PossiblyRedactedThirdPartyInvite>If this member event is the successor to a third party invitation, this field will contain information about that invitation.
blurhash: Option<String>§reason: Option<String>User-supplied text for why their membership has changed.
For kicks and bans, this is typically the reason for the kick or ban. For other membership changes, this is a way for the user to communicate their intent without having to send a message to the room, such as in a case where Bob rejects an invite from Alice about an upcoming concert, but can’t make it that day.
Clients are not recommended to show this reason to users when receiving an invite due to the potential for spam and abuse. Hiding the reason behind a button or other component is recommended.
Arbitrarily chosen UserId (MxID) of a local user who can send an invite.
Implementations§
§impl PossiblyRedactedRoomMemberEventContent
impl PossiblyRedactedRoomMemberEventContent
pub fn new(
membership: MembershipState,
) -> PossiblyRedactedRoomMemberEventContent
pub fn new( membership: MembershipState, ) -> PossiblyRedactedRoomMemberEventContent
Creates a new PossiblyRedactedRoomMemberEventContent with the given membership state.
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>>,
sender: &UserId,
state_key: &UserId,
) -> MembershipChange<'a>
pub fn membership_change<'a>( &'a self, prev_details: Option<MembershipDetails<'a>>, sender: &UserId, state_key: &UserId, ) -> MembershipChange<'a>
Helper function for membership change.
This requires data from the full event:
- The previous details computed from
event.unsigned.prev_content, - The sender of the event,
- The state key of the event.
Check the specification for details.
Trait Implementations§
§impl Clone for PossiblyRedactedRoomMemberEventContent
impl Clone for PossiblyRedactedRoomMemberEventContent
§fn clone(&self) -> PossiblyRedactedRoomMemberEventContent
fn clone(&self) -> PossiblyRedactedRoomMemberEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<'de> Deserialize<'de> for PossiblyRedactedRoomMemberEventContent
impl<'de> Deserialize<'de> for PossiblyRedactedRoomMemberEventContent
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PossiblyRedactedRoomMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PossiblyRedactedRoomMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl From<PossiblyRedactedRoomMemberEventContent> for AnyPossiblyRedactedStateEventContent
impl From<PossiblyRedactedRoomMemberEventContent> for AnyPossiblyRedactedStateEventContent
§fn from(
c: PossiblyRedactedRoomMemberEventContent,
) -> AnyPossiblyRedactedStateEventContent
fn from( c: PossiblyRedactedRoomMemberEventContent, ) -> AnyPossiblyRedactedStateEventContent
§impl From<RedactedRoomMemberEventContent> for PossiblyRedactedRoomMemberEventContent
impl From<RedactedRoomMemberEventContent> for PossiblyRedactedRoomMemberEventContent
§fn from(
value: RedactedRoomMemberEventContent,
) -> PossiblyRedactedRoomMemberEventContent
fn from( value: RedactedRoomMemberEventContent, ) -> PossiblyRedactedRoomMemberEventContent
§impl From<RoomMemberEventContent> for PossiblyRedactedRoomMemberEventContent
impl From<RoomMemberEventContent> for PossiblyRedactedRoomMemberEventContent
§fn from(value: RoomMemberEventContent) -> PossiblyRedactedRoomMemberEventContent
fn from(value: RoomMemberEventContent) -> PossiblyRedactedRoomMemberEventContent
§impl PossiblyRedactedStateEventContent for PossiblyRedactedRoomMemberEventContent
impl PossiblyRedactedStateEventContent for PossiblyRedactedRoomMemberEventContent
§type StateKey = OwnedUserId
type StateKey = OwnedUserId
state_key field.§fn event_type(&self) -> StateEventType
fn event_type(&self) -> StateEventType
m.room.name.§impl RedactContent for PossiblyRedactedRoomMemberEventContent
impl RedactContent for PossiblyRedactedRoomMemberEventContent
§type Redacted = PossiblyRedactedRoomMemberEventContent
type Redacted = PossiblyRedactedRoomMemberEventContent
§fn redact(
self,
rules: &RedactionRules,
) -> PossiblyRedactedRoomMemberEventContent
fn redact( self, rules: &RedactionRules, ) -> PossiblyRedactedRoomMemberEventContent
self into a redacted form (removing most or all fields) according to the spec. Read more§impl Serialize for PossiblyRedactedRoomMemberEventContent
impl Serialize for PossiblyRedactedRoomMemberEventContent
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl StaticEventContent for PossiblyRedactedRoomMemberEventContent
impl StaticEventContent for PossiblyRedactedRoomMemberEventContent
§const TYPE: &'static str = RoomMemberEventContent::TYPE
const TYPE: &'static str = RoomMemberEventContent::TYPE
§type IsPrefix = <RoomMemberEventContent as StaticEventContent>::IsPrefix
type IsPrefix = <RoomMemberEventContent as StaticEventContent>::IsPrefix
impl JsonCastable<AnyPossiblyRedactedStateEventContent> for PossiblyRedactedRoomMemberEventContent
Auto Trait Implementations§
impl Freeze for PossiblyRedactedRoomMemberEventContent
impl RefUnwindSafe for PossiblyRedactedRoomMemberEventContent
impl Send for PossiblyRedactedRoomMemberEventContent
impl Sync for PossiblyRedactedRoomMemberEventContent
impl Unpin for PossiblyRedactedRoomMemberEventContent
impl UnwindSafe for PossiblyRedactedRoomMemberEventContent
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> EventContentFromType for Twhere
T: StaticEventContent + DeserializeOwned,
impl<T> EventContentFromType for Twhere
T: StaticEventContent + DeserializeOwned,
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more