pub struct RedactedRoomMemberEventContent {
pub membership: MembershipState,
pub third_party_invite: Option<RedactedThirdPartyInvite>,
pub join_authorized_via_users_server: Option<OwnedUserId>,
}
events
only.Expand description
A member event that has been redacted.
Fields§
§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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> EventContentFromType for Twhere
T: EventContent + DeserializeOwned,
impl<T> EventContentFromType for Twhere
T: EventContent + DeserializeOwned,
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,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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