Skip to main content

RoomMember

Struct RoomMember 

Source
pub struct RoomMember { /* private fields */ }
Expand description

A member of a room.

Implementations§

Source§

impl RoomMember

Source

pub fn user_id(&self) -> &UserId

Get the unique user id of this member.

Source

pub fn event(&self) -> &Arc<MemberEvent>

Get the original member event

Source

pub fn display_name(&self) -> Option<&str>

Get the display name of the member if there is one.

Source

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.

Source

pub fn avatar_url(&self) -> Option<&MxcUri>

Get the avatar url of the member, if there is one.

Source

pub fn status(&self) -> Option<&StatusProfileField>

Available on crate feature unstable-msc4426 only.

Get the user’s status, if any.

This is the user-set status (emoji + text) taken from the user’s global profile.

Global profiles are only populated when syncing via sliding sync with the profiles extension enabled; this is always None under sync v2.

Source

pub fn call(&self) -> Option<&CallProfileField>

Available on crate feature unstable-msc4426 only.

Get the user’s call indicator, if any.

This indicates the user is currently in a call (and optionally how long they’ve been in it). It is taken from the user’s global profile.

Global profiles are only populated when syncing via sliding sync with the profiles extension enabled; this is always None under sync v2.

Source

pub fn normalized_power_level(&self) -> UserPowerLevel

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 that are not Infinite are always in the range of 0-100.

Source

pub fn power_level(&self) -> UserPowerLevel

Get the power level of this member.

Source

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).

Source

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).

Source

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).

Source

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).

Source

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).

Source

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)).

Source

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)).

Source

pub fn can_pin_or_unpin_event(&self) -> bool

Whether this user can pin or unpin events based on the power levels.

Source

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)).

Source

pub fn can_do(&self, action: PowerLevelAction) -> bool

Whether this user can do the given action based on the power levels.

Source

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.

Source

pub fn membership(&self) -> &MembershipState

Get the membership state of this member.

Source

pub fn is_ignored(&self) -> bool

Is the room member ignored by the current account user

Source

pub fn is_service_member(&self) -> bool

Is the room member a service member.

Trait Implementations§

Source§

impl Clone for RoomMember

Source§

fn clone(&self) -> RoomMember

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RoomMember

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsyncTraitDeps for T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>
where T: Sized,

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> DropFlavorWrapper<T> for T

Source§

type Flavor = MayDrop

The DropFlavor that wraps T into Self
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> JsonCastable<CanonicalJsonValue> for T

§

impl<T> JsonCastable<Value> for T

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> SendOutsideWasm for T
where T: Send,

§

impl<T> SyncOutsideWasm for T
where T: Sync,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more