pub struct User {Show 21 fields
pub username: String,
pub fullname: Option<String>,
pub avatar_url: Option<String>,
pub user_type: Option<String>,
pub details: Option<String>,
pub is_following: Option<bool>,
pub is_pro: Option<bool>,
pub num_models: Option<u64>,
pub num_datasets: Option<u64>,
pub num_spaces: Option<u64>,
pub num_discussions: Option<u64>,
pub num_papers: Option<u64>,
pub num_upvotes: Option<u64>,
pub num_likes: Option<u64>,
pub num_following: Option<u64>,
pub num_followers: Option<u64>,
pub email: Option<String>,
pub email_verified: Option<bool>,
pub plan: Option<String>,
pub can_pay: Option<bool>,
pub orgs: Option<Vec<OrgMembership>>,
}Expand description
A Hugging Face Hub user account.
Returned by HFClient::whoami and the various user-lookup endpoints.
Only username is guaranteed to be set; the remaining
fields are populated for the authenticated caller’s own whoami response
or when the field is publicly visible on the target user’s profile.
Fields§
§username: StringHub handle (slug) of the user — the name used in URLs such as
https://huggingface.co/<username>.
fullname: Option<String>Display name as shown on the user’s profile, when set.
avatar_url: Option<String>URL to the user’s avatar image.
user_type: Option<String>Account type, typically "user" or "org".
details: Option<String>Free-text bio shown on the user’s profile.
is_following: Option<bool>Whether the authenticated caller follows this user.
is_pro: Option<bool>Whether the user is on a Pro plan.
num_models: Option<u64>Number of models created by the user.
num_datasets: Option<u64>Number of datasets created by the user.
num_spaces: Option<u64>Number of Spaces created by the user.
num_discussions: Option<u64>Number of discussions initiated by the user.
num_papers: Option<u64>Number of papers authored by the user.
num_upvotes: Option<u64>Upvotes the user has received.
num_likes: Option<u64>Likes the user has given.
num_following: Option<u64>Number of users this user is following.
num_followers: Option<u64>Number of users following this user.
email: Option<String>Email address — only returned by whoami for the authenticated user.
email_verified: Option<bool>Whether the email has been verified — only returned by whoami.
plan: Option<String>Billing plan identifier — only returned by whoami.
can_pay: Option<bool>Whether the account has a valid payment method — only returned by whoami.
orgs: Option<Vec<OrgMembership>>Organizations the authenticated user belongs to. Only populated by
whoami for the caller themselves.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for User
impl<'de> Deserialize<'de> for User
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>,
Auto Trait Implementations§
impl Freeze for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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