Struct matrix_sdk::ruma::events::room::member::RedactedRoomMemberEventContent
source · #[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
§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
§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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