Struct rouille::Session [] [src]

pub struct Session<'a, T> where T: Clone + 'a {
    // some fields omitted
}

Represents an entry in the sessions manager.

Methods

impl<'a, T> Session<'a, T> where T: Clone

fn get(&self) -> Option<T>

Load the session infos from the manager. Returns None if there is no data yet.

Note that calling get twice in a row can produce different results. That can happen if two requests are processed in parallel and access the same session.

fn has_data(&self) -> bool

Returns true if there is session data.

fn set(&self, value: T)

Stores the session infos in the manager.

fn clear(&self)

Removes the session infos from the manager.

fn apply(&self, response: Response) -> Response

Applies the session on the Response. If you don't do that, the session won't be maintained on further connections.