[][src]Struct carapax_session::Session

pub struct Session<B> { /* fields omitted */ }

Actual session

Methods

impl<B> Session<B> where
    B: SessionBackend
[src]

pub async fn set<K, V>(
    &'_ mut self,
    key: K,
    value: &'_ V
) -> Result<(), SessionError> where
    K: AsRef<str>,
    V: Serialize
[src]

Sets a value for key

pub async fn get<K, O>(&'_ mut self, key: K) -> Result<Option<O>, SessionError> where
    K: AsRef<str>,
    O: DeserializeOwned
[src]

Gets a value for key

pub async fn expire<K>(
    &'_ mut self,
    key: K,
    seconds: u64
) -> Result<(), SessionError> where
    K: AsRef<str>, 
[src]

Expires a key

pub async fn remove<K>(&'_ mut self, key: K) -> Result<(), SessionError> where
    K: AsRef<str>, 
[src]

Removes a key

Trait Implementations

impl<B> Clone for Session<B> where
    B: Clone
[src]

Auto Trait Implementations

impl<B> !RefUnwindSafe for Session<B>

impl<B> Send for Session<B> where
    B: Send

impl<B> Sync for Session<B> where
    B: Send

impl<B> Unpin for Session<B>

impl<B> !UnwindSafe for Session<B>

Blanket Implementations

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

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

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

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

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

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.