#[non_exhaustive]pub struct RedactedRoomMemberEventContent {
pub membership: MembershipState,
pub third_party_invite: Option<RedactedThirdPartyInvite>,
pub join_authorized_via_users_server: Option<OwnedUserId>,
}
Expand description
A member event that has been redacted.
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.membership: MembershipState
The membership state of this user.
third_party_invite: Option<RedactedThirdPartyInvite>
If this member event is the successor to a third party invitation, this field will contain information about that invitation.
An arbitrary user who has the power to issue invites.
This is redacted in room versions 8 and below. It is used for validating joins when the join rule is restricted.
Implementations§
Source§impl RedactedRoomMemberEventContent
impl RedactedRoomMemberEventContent
Sourcepub fn new(membership: MembershipState) -> RedactedRoomMemberEventContent
pub fn new(membership: MembershipState) -> RedactedRoomMemberEventContent
Create a RedactedRoomMemberEventContent
with the given membership.
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>>,
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.
Since redacted 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).
This also requires data from the full event:
- The sender of the event,
- The state key of the event.
Check the specification for details.
Trait Implementations§
Source§impl Clone for RedactedRoomMemberEventContent
impl Clone for RedactedRoomMemberEventContent
Source§fn clone(&self) -> RedactedRoomMemberEventContent
fn clone(&self) -> RedactedRoomMemberEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de> Deserialize<'de> for RedactedRoomMemberEventContent
impl<'de> Deserialize<'de> for RedactedRoomMemberEventContent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RedactedRoomMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RedactedRoomMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl EventContent for RedactedRoomMemberEventContent
impl EventContent for RedactedRoomMemberEventContent
Source§type EventType = StateEventType
type EventType = StateEventType
Source§fn event_type(&self) -> StateEventType
fn event_type(&self) -> StateEventType
m.room.message
.Source§impl RedactedStateEventContent for RedactedRoomMemberEventContent
impl RedactedStateEventContent for RedactedRoomMemberEventContent
Source§type StateKey = OwnedUserId
type StateKey = OwnedUserId
state_key
field.Source§impl Serialize for RedactedRoomMemberEventContent
impl Serialize for RedactedRoomMemberEventContent
Source§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,
Auto Trait Implementations§
impl Freeze for RedactedRoomMemberEventContent
impl RefUnwindSafe for RedactedRoomMemberEventContent
impl Send for RedactedRoomMemberEventContent
impl Sync for RedactedRoomMemberEventContent
impl Unpin for RedactedRoomMemberEventContent
impl UnwindSafe for RedactedRoomMemberEventContent
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
Source§impl<T> EventContentFromType for Twhere
T: EventContent + DeserializeOwned,
impl<T> EventContentFromType for Twhere
T: EventContent + DeserializeOwned,
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
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