Struct rocket_auth::Session[][src]

pub struct Session {
    pub id: i32,
    pub email: String,
    pub auth_key: String,
    pub time_stamp: i32,
}

The Session guard can be used to retrieve user session data. Unlike User, using session does not verify that the session data is still valid. Since the client could have logged out, or their session may have expired. The Session guard is intended for purposes where verifying the validity of the session data is unnecessary.

Note that, session data is already captured by the [Auth] guard and stored in the public session field. So it is not necesarry to use them together.

Fields

id: i32

The user id as it is stored on the database.

email: String

The user email.

auth_key: String

An random authentication token key.

time_stamp: i32

It represents the Unix time in which the user logged in. It is measured in seconds.

Trait Implementations

impl Clone for Session[src]

impl Debug for Session[src]

impl<'de> Deserialize<'de> for Session[src]

impl<'a, 'r> FromRequest<'a, 'r> for Session[src]

type Error = Error

The associated error to be returned if derivation fails.

impl Serialize for Session[src]

Auto Trait Implementations

impl RefUnwindSafe for Session

impl Send for Session

impl Sync for Session

impl Unpin for Session

impl UnwindSafe for Session

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoCollection<T> for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,