Struct matrix_sdk_base::RoomMember
source · pub struct RoomMember { /* private fields */ }
Expand description
A member of a room.
Implementations§
source§impl RoomMember
impl RoomMember
sourcepub fn event(&self) -> &Arc<MemberEvent>
pub fn event(&self) -> &Arc<MemberEvent>
Get the original member event
sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Get the display name of the member if there is one.
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Get the name of the member.
This returns either the display name or the local part of the user id if the member didn’t set a display name.
sourcepub fn avatar_url(&self) -> Option<&MxcUri>
pub fn avatar_url(&self) -> Option<&MxcUri>
Get the avatar url of the member, if there is one.
sourcepub fn normalized_power_level(&self) -> i64
pub fn normalized_power_level(&self) -> i64
Get the normalized power level of this member.
The normalized power level depends on the maximum power level that can be found in a certain room, positive values are always in the range of 0-100.
sourcepub fn power_level(&self) -> i64
pub fn power_level(&self) -> i64
Get the power level of this member.
sourcepub fn can_ban(&self) -> bool
pub fn can_ban(&self) -> bool
Whether this user can ban other users based on the power levels.
Same as member.can_do(PowerLevelAction::Ban)
.
sourcepub fn can_invite(&self) -> bool
pub fn can_invite(&self) -> bool
Whether this user can invite other users based on the power levels.
Same as member.can_do(PowerLevelAction::Invite)
.
sourcepub fn can_kick(&self) -> bool
pub fn can_kick(&self) -> bool
Whether this user can kick other users based on the power levels.
Same as member.can_do(PowerLevelAction::Kick)
.
sourcepub fn can_redact_own(&self) -> bool
pub fn can_redact_own(&self) -> bool
Whether this user can redact their own events based on the power levels.
Same as member.can_do(PowerLevelAction::RedactOwn)
.
sourcepub fn can_redact_other(&self) -> bool
pub fn can_redact_other(&self) -> bool
Whether this user can redact events of other users based on the power levels.
Same as member.can_do(PowerLevelAction::RedactOther)
.
sourcepub fn can_send_message(&self, msg_type: MessageLikeEventType) -> bool
pub fn can_send_message(&self, msg_type: MessageLikeEventType) -> bool
Whether this user can send message events based on the power levels.
Same as member.can_do(PowerLevelAction::SendMessage(msg_type))
.
sourcepub fn can_send_state(&self, state_type: StateEventType) -> bool
pub fn can_send_state(&self, state_type: StateEventType) -> bool
Whether this user can send state events based on the power levels.
Same as member.can_do(PowerLevelAction::SendState(state_type))
.
sourcepub fn can_pin_or_unpin_event(&self) -> bool
pub fn can_pin_or_unpin_event(&self) -> bool
Whether this user can pin or unpin events based on the power levels.
sourcepub fn can_trigger_room_notification(&self) -> bool
pub fn can_trigger_room_notification(&self) -> bool
Whether this user can notify everybody in the room by writing @room
in
a message.
Same as member. can_do(PowerLevelAction::TriggerNotification(NotificationPowerLevelType::Room))
.
sourcepub fn can_do(&self, action: PowerLevelAction) -> bool
pub fn can_do(&self, action: PowerLevelAction) -> bool
Whether this user can do the given action based on the power levels.
sourcepub fn name_ambiguous(&self) -> bool
pub fn name_ambiguous(&self) -> bool
Is the name that the member uses ambiguous in the room.
A name is considered to be ambiguous if at least one other member shares the same name.
sourcepub fn membership(&self) -> &MembershipState
pub fn membership(&self) -> &MembershipState
Get the membership state of this member.
sourcepub fn is_ignored(&self) -> bool
pub fn is_ignored(&self) -> bool
Is the room member ignored by the current account user
Trait Implementations§
source§impl Clone for RoomMember
impl Clone for RoomMember
source§fn clone(&self) -> RoomMember
fn clone(&self) -> RoomMember
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for RoomMember
impl RefUnwindSafe for RoomMember
impl Send for RoomMember
impl Sync for RoomMember
impl Unpin for RoomMember
impl UnwindSafe for RoomMember
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
)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