Struct medal::db_objects::SessionUser
source · pub struct SessionUser {Show 28 fields
pub id: i32,
pub session_token: Option<String>,
pub csrf_token: String,
pub last_login: Option<Timespec>,
pub last_activity: Option<Timespec>,
pub account_created: Option<Timespec>,
pub username: Option<String>,
pub password: Option<String>,
pub salt: Option<String>,
pub logincode: Option<String>,
pub email: Option<String>,
pub email_unconfirmed: Option<String>,
pub email_confirmationcode: Option<String>,
pub firstname: Option<String>,
pub lastname: Option<String>,
pub street: Option<String>,
pub zip: Option<String>,
pub city: Option<String>,
pub nation: Option<String>,
pub grade: i32,
pub sex: Option<i32>,
pub anonymous: bool,
pub is_admin: Option<bool>,
pub is_teacher: bool,
pub managed_by: Option<i32>,
pub school_name: Option<String>,
pub oauth_foreign_id: Option<String>,
pub oauth_provider: Option<String>,
}
Fields§
§id: i32
§session_token: Option<String>
§csrf_token: String
§last_login: Option<Timespec>
§last_activity: Option<Timespec>
§account_created: Option<Timespec>
§username: Option<String>
§password: Option<String>
§salt: Option<String>
§logincode: Option<String>
§email: Option<String>
§email_unconfirmed: Option<String>
§email_confirmationcode: Option<String>
§firstname: Option<String>
§lastname: Option<String>
§street: Option<String>
§zip: Option<String>
§city: Option<String>
§nation: Option<String>
§grade: i32
§sex: Option<i32>
§anonymous: bool
§is_admin: Option<bool>
§is_teacher: bool
§managed_by: Option<i32>
§school_name: Option<String>
§oauth_foreign_id: Option<String>
§oauth_provider: Option<String>
Implementations§
source§impl SessionUser
impl SessionUser
pub fn minimal(id: i32, session_token: String, csrf_token: String) -> Self
pub fn group_user_stub() -> Self
pub fn is_alive(&self) -> bool
pub fn is_logged_in(&self) -> bool
pub fn is_teacher(&self) -> bool
pub fn is_admin(&self) -> bool
pub fn ensure_alive(self) -> Option<Self>
pub fn ensure_logged_in(self) -> Option<Self>
pub fn ensure_teacher(self) -> Option<Self>
pub fn ensure_admin(self) -> Option<Self>
pub fn ensure_teacher_or_admin(self) -> Option<Self>
Trait Implementations§
source§impl Clone for SessionUser
impl Clone for SessionUser
source§fn clone(&self) -> SessionUser
fn clone(&self) -> SessionUser
Returns a copy 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 SessionUser
impl Debug for SessionUser
source§impl SetPassword for SessionUser
impl SetPassword for SessionUser
Auto Trait Implementations§
impl Freeze for SessionUser
impl RefUnwindSafe for SessionUser
impl Send for SessionUser
impl Sync for SessionUser
impl Unpin for SessionUser
impl UnwindSafe for SessionUser
Blanket Implementations§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
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
§impl<T> CloneAny for T
impl<T> CloneAny for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PersistentInto<Arc<Mutex<T>>> for T
impl<T> PersistentInto<Arc<Mutex<T>>> for T
§fn persistent_into(self) -> Arc<Mutex<T>>
fn persistent_into(self) -> Arc<Mutex<T>>
Convert
self
into a value of type T
.§impl<T> PersistentInto<Arc<RwLock<T>>> for T
impl<T> PersistentInto<Arc<RwLock<T>>> for T
§fn persistent_into(self) -> Arc<RwLock<T>>
fn persistent_into(self) -> Arc<RwLock<T>>
Convert
self
into a value of type T
.§impl<T> PersistentInto<Arc<T>> for T
impl<T> PersistentInto<Arc<T>> for T
§fn persistent_into(self) -> Arc<T>
fn persistent_into(self) -> Arc<T>
Convert
self
into a value of type T
.§impl<T> PersistentInto<T> for T
impl<T> PersistentInto<T> for T
§fn persistent_into(self) -> T
fn persistent_into(self) -> T
Convert
self
into a value of type T
.