pub struct BaseRoomMember { /* private fields */ }
Expand description
A member of a room.
Implementations§
Source§impl RoomMember
impl RoomMember
Sourcepub fn event(&self) -> &Arc<SyncOrStrippedState<RoomMemberEventContent>>
pub fn event(&self) -> &Arc<SyncOrStrippedState<RoomMemberEventContent>>
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
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