pub struct CachedMember { /* private fields */ }
Expand description

Represents a cached Member.

Implementations§

source§

impl CachedMember

source

pub const fn avatar(&self) -> Option<ImageHash>

Member’s guild avatar.

source

pub const fn communication_disabled_until(&self) -> Option<Timestamp>

When the user can resume communication in a guild again.

Checking if this value is Some is not enough to know if a used is currently timed out as Discord doesn’t send any events when the timeout expires, and therefore the cache is not updated accordingly. You should ensure that the provided Timestamp is not in the past. See discord-api-docs#4269.

source

pub const fn deaf(&self) -> Option<bool>

Whether the member is deafened in a voice channel.

source

pub const fn flags(&self) -> MemberFlags

Flags for the member.

Defaults to an empty bitfield.

source

pub const fn joined_at(&self) -> Timestamp

Timestamp of this member’s join date.

source

pub const fn mute(&self) -> Option<bool>

Whether the member is muted in a voice channel.

source

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

Nickname of the member.

source

pub const fn pending(&self) -> bool

Whether the member has not yet passed the guild’s Membership Screening requirements.

source

pub const fn premium_since(&self) -> Option<Timestamp>

Timestamp of the date the member boosted the guild.

source

pub fn roles(&self) -> &[Id<RoleMarker>]

List of role IDs this member has.

source

pub const fn user_id(&self) -> Id<UserMarker>

ID of the user relating to the member.

Trait Implementations§

source§

impl Clone for CachedMember

source§

fn clone(&self) -> CachedMember

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for CachedMember

source§

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

Formats the value using the given formatter. Read more
source§

impl PartialEq<CachedMember> for CachedMember

source§

fn eq(&self, other: &CachedMember) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<InteractionMember> for CachedMember

source§

fn eq(&self, other: &InteractionMember) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Member> for CachedMember

source§

fn eq(&self, other: &Member) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<PartialMember> for CachedMember

source§

fn eq(&self, other: &PartialMember) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for CachedMember

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for CachedMember

source§

impl StructuralEq for CachedMember

source§

impl StructuralPartialEq for CachedMember

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.