pub struct User {
pub id: i64,
pub username: String,
pub email: Option<String>,
pub roles: Vec<String>,
pub permissions: Vec<String>,
pub metadata: HashMap<String, Value>,
}Fields§
§id: i64§username: String§email: Option<String>§roles: Vec<String>§permissions: Vec<String>§metadata: HashMap<String, Value>Implementations§
Source§impl User
impl User
pub fn new(id: i64, username: impl Into<String>) -> Self
pub fn with_email(self, email: impl Into<String>) -> Self
pub fn with_roles(self, roles: Vec<String>) -> Self
pub fn with_permissions(self, permissions: Vec<String>) -> Self
pub fn has_role(&self, role: &str) -> bool
pub fn has_permission(&self, permission: &str) -> bool
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