pub struct User {
pub id: String,
pub email: String,
pub user_name: Option<String>,
pub user_avatar_url: Option<String>,
pub admin_scopes: Option<Vec<String>>,
pub allowed_email_domains: Option<Vec<String>>,
}Expand description
User type for JWT generation Optional fields: user_name (max 200 chars), user_avatar_url (HTTPS URL, max 2000 chars), admin_scopes, allowed_email_domains
Fields§
§id: String§email: String§user_name: Option<String>§user_avatar_url: Option<String>§admin_scopes: Option<Vec<String>>§allowed_email_domains: Option<Vec<String>>Optional list of allowed email domains for invitation restrictions (e.g., [“acme.com”, “acme.org”])
Implementations§
Source§impl User
impl User
pub fn new(id: &str, email: &str) -> Self
pub fn with_user_name(self, name: &str) -> Self
pub fn with_user_avatar_url(self, avatar_url: &str) -> Self
pub fn with_admin_scopes(self, scopes: Vec<String>) -> Self
pub fn with_allowed_email_domains(self, domains: Vec<String>) -> Self
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more