Struct ruma_events::room::member::RedactedRoomMemberEventContent
source · 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§
§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) -> Self
pub fn new(membership: MembershipState) -> Self
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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.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
)