[][src]Struct carapax_session::Session

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

Actual session available in context

Methods

impl<S> Session<S> where
    S: SessionStore
[src]

pub fn get<O>(
    &self,
    key: &str
) -> Box<dyn Future<Item = Option<O>, Error = Error> + Send> where
    O: DeserializeOwned + Send + 'static, 
[src]

Get value of key

If key not exists, None is returned

pub fn set<I>(
    &self,
    key: &str,
    val: &I
) -> Box<dyn Future<Item = (), Error = Error> + Send> where
    I: Serialize
[src]

Set key to hold the given value

pub fn expire(
    &self,
    key: &str,
    seconds: usize
) -> Box<dyn Future<Item = (), Error = Error> + Send>
[src]

Set a timeout on key

After the timeout has expired, the key will automatically be deleted

pub fn del(&self, key: &str) -> Box<dyn Future<Item = (), Error = Error> + Send>[src]

Remove the specified key

Trait Implementations

impl<S: Clone> Clone for Session<S>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<S> Send for Session<S> where
    S: Send + Sync

impl<S> Sync for Session<S> where
    S: Send + Sync

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Any for T where
    T: Any

impl<T> Erased for T

impl<T> CloneAny for T where
    T: Clone + Any