Struct twilight_model::user::UserProfile
source · pub struct UserProfile {Show 13 fields
pub accent_color: Option<u32>,
pub avatar: Option<ImageHash>,
pub banner: Option<ImageHash>,
pub bot: bool,
pub discriminator: u16,
pub email: Option<String>,
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 verified: Option<bool>,
}
Fields§
§accent_color: Option<u32>
Accent color of the user’s banner.
This is an integer representation of a hexadecimal color code.
avatar: Option<ImageHash>
Hash of the user’s banner image.
bot: bool
§discriminator: u16
Discriminator used to differentiate people with the same username.
Formatting
Because discriminators are stored as an integer they’re not in the
format of Discord user tags due to a lack of padding with zeros. The
discriminator
method can be used to retrieve a formatter to pad the
discriminator with zeros.
serde
The discriminator field can be deserialized from either a string or an integer. The field will always serialize into a string due to that being the type Discord’s API uses.
email: Option<String>
§flags: Option<UserFlags>
§id: Id<UserMarker>
§locale: Option<String>
§mfa_enabled: Option<bool>
§name: String
§verified: Option<bool>
Implementations§
source§impl UserProfile
impl UserProfile
sourcepub const fn discriminator(&self) -> DiscriminatorDisplay
pub const fn discriminator(&self) -> DiscriminatorDisplay
Create a Display
formatter for a user discriminator that pads the
discriminator with zeros up to 4 digits.
Trait Implementations§
source§impl Clone for UserProfile
impl Clone for UserProfile
source§fn clone(&self) -> UserProfile
fn clone(&self) -> UserProfile
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UserProfile
impl Debug for UserProfile
source§impl<'de> Deserialize<'de> for UserProfile
impl<'de> Deserialize<'de> for UserProfile
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for UserProfile
impl Hash for UserProfile
source§impl PartialEq<UserProfile> for UserProfile
impl PartialEq<UserProfile> for UserProfile
source§fn eq(&self, other: &UserProfile) -> bool
fn eq(&self, other: &UserProfile) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for UserProfile
impl Serialize for UserProfile
impl Eq for UserProfile
impl StructuralEq for UserProfile
impl StructuralPartialEq for UserProfile
Auto Trait Implementations§
impl RefUnwindSafe for UserProfile
impl Send for UserProfile
impl Sync for UserProfile
impl Unpin for UserProfile
impl UnwindSafe for UserProfile
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
Mutably borrows from an owned value. Read more