Struct sparkle_cache::model::CachedMember
source · pub struct CachedMember {Show 22 fields
pub guild_avatar: Option<ImageHash>,
pub communication_disabled_until: Option<Timestamp>,
pub deaf: bool,
pub guild_id: Id<GuildMarker>,
pub joined_at: Timestamp,
pub mute: bool,
pub nick: Option<String>,
pub pending: bool,
pub premium_since: Option<Timestamp>,
pub accent_color: Option<u32>,
pub avatar: Option<ImageHash>,
pub banner: Option<ImageHash>,
pub bot: bool,
pub discriminator: u16,
pub flags: Option<UserFlags>,
pub id: Id<UserMarker>,
pub locale: Option<String>,
pub mfa_enabled: Option<bool>,
pub name: String,
pub premium_type: Option<PremiumType>,
pub public_flags: Option<UserFlags>,
pub system: Option<bool>,
}Expand description
A cached member
It’s the same as twilight_model::guild::member::Member except:
-
userfield is flattened andavatarfield is renamed toguild_avatarsince member users are rarely duplicates, making this struct easier to cache -
rolesfield is removed, as member roles are cached separately -
emailandverifiedfields are removed, as they’re only sent in some HTTP endpoints
Fields
guild_avatar: Option<ImageHash>communication_disabled_until: Option<Timestamp>deaf: boolguild_id: Id<GuildMarker>joined_at: Timestampmute: boolnick: Option<String>pending: boolaccent_color: Option<u32>avatar: Option<ImageHash>bot: booldiscriminator: u16flags: Option<UserFlags>id: Id<UserMarker>locale: Option<String>mfa_enabled: Option<bool>name: Stringpublic_flags: Option<UserFlags>system: Option<bool>Implementations
sourceimpl CachedMember
impl CachedMember
sourcepub fn communication_disabled(&self) -> Result<bool, ComponentRange>
pub fn communication_disabled(&self) -> Result<bool, ComponentRange>
sourcepub fn update(&mut self, member: &MemberUpdate)
pub fn update(&mut self, member: &MemberUpdate)
Update the cached member with the partial member
Trait Implementations
sourceimpl Clone for CachedMember
impl Clone for CachedMember
sourcefn clone(&self) -> CachedMember
fn clone(&self) -> CachedMember
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for CachedMember
impl Debug for CachedMember
Auto Trait Implementations
impl RefUnwindSafe for CachedMember
impl Send for CachedMember
impl Sync for CachedMember
impl Unpin for CachedMember
impl UnwindSafe for CachedMember
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more