Struct discord_flows::model::User
source · pub struct User {
pub id: UserId,
pub avatar: Option<String>,
pub bot: bool,
pub discriminator: u16,
pub name: String,
pub public_flags: Option<UserPublicFlags>,
pub banner: Option<String>,
pub accent_colour: Option<u32>,
pub member: Option<Box<PartialMember, Global>>,
}
Expand description
Information about a user.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: UserId
The unique Id of the user. Can be used to calculate the account’s creation date.
avatar: Option<String>
Optional avatar hash.
bot: bool
Indicator of whether the user is a bot.
discriminator: u16
The account’s discriminator to differentiate the user from others with
the same Self::name
. The name+discriminator pair is always unique.
name: String
The account’s username. Changing username will trigger a discriminator change if the username+discriminator pair becomes non-unique.
public_flags: Option<UserPublicFlags>
The public flags on a user’s account
Optional banner hash.
Note: This will only be present if the user is fetched via Rest API,
e.g. with [Http::get_user
].
accent_colour: Option<u32>
§member: Option<Box<PartialMember, Global>>
Only included in Message::mentions
for messages from the gateway.
Trait Implementations§
source§impl<'de> Deserialize<'de> for User
impl<'de> Deserialize<'de> for User
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<User, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<User, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> From<&'a CurrentUser> for User
impl<'a> From<&'a CurrentUser> for User
source§fn from(user: &'a CurrentUser) -> User
fn from(user: &'a CurrentUser) -> User
Converts to this type from the input type.
source§impl From<CurrentUser> for User
impl From<CurrentUser> for User
source§fn from(user: CurrentUser) -> User
fn from(user: CurrentUser) -> User
Converts to this type from the input type.
source§impl Mentionable for User
impl Mentionable for User
source§impl PartialEq<User> for User
impl PartialEq<User> for User
source§impl Serialize for User
impl Serialize for User
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for User
Auto Trait Implementations§
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnwindSafe for User
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