pub struct UserProfile {
pub id: String,
pub provider: String,
pub username: Option<String>,
pub name: Option<String>,
pub email: Option<String>,
pub email_verified: Option<bool>,
pub picture: Option<String>,
pub locale: Option<String>,
pub additional_data: HashMap<String, Value>,
}Expand description
Standardized user profile across all providers.
Fields§
§id: StringUnique identifier from the provider
provider: StringProvider that authenticated this user
username: Option<String>Username or login name
name: Option<String>Display name
email: Option<String>Email address
email_verified: Option<bool>Whether email is verified
picture: Option<String>Profile picture URL
locale: Option<String>Locale/language preference
additional_data: HashMap<String, Value>Provider-specific additional data
Implementations§
Source§impl UserProfile
impl UserProfile
Sourcepub fn new(id: impl Into<String>, provider: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, provider: impl Into<String>) -> Self
Create a new user profile
Sourcepub fn with_username(self, username: impl Into<String>) -> Self
pub fn with_username(self, username: impl Into<String>) -> Self
Set username
Sourcepub fn with_email(self, email: impl Into<String>) -> Self
pub fn with_email(self, email: impl Into<String>) -> Self
Set email
Sourcepub fn with_email_verified(self, verified: bool) -> Self
pub fn with_email_verified(self, verified: bool) -> Self
Set email verification status
Sourcepub fn with_picture(self, picture: impl Into<String>) -> Self
pub fn with_picture(self, picture: impl Into<String>) -> Self
Set profile picture URL
Sourcepub fn with_locale(self, locale: impl Into<String>) -> Self
pub fn with_locale(self, locale: impl Into<String>) -> Self
Set locale
Sourcepub fn with_additional_data(self, key: impl Into<String>, value: Value) -> Self
pub fn with_additional_data(self, key: impl Into<String>, value: Value) -> Self
Add additional provider-specific data
Trait Implementations§
Source§impl Clone for UserProfile
impl Clone for UserProfile
Source§fn clone(&self) -> UserProfile
fn clone(&self) -> UserProfile
Returns a duplicate 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
Auto Trait Implementations§
impl Freeze for UserProfile
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