pub trait SessionConnExt {
    // Required methods
    fn with_session(self, key: &str, value: impl Serialize) -> Self;
    fn session(&self) -> &Session;
    fn session_mut(&mut self) -> &mut Session;
}
Expand description

extension trait to add session support to Conn

SessionHandler MUST be called on the conn prior to using any of these functions.

Required Methods§

source

fn with_session(self, key: &str, value: impl Serialize) -> Self

append a key-value pair to the current session, where the key is a &str and the value is anything serde-serializable.

source

fn session(&self) -> &Session

retrieve a reference to the current session

source

fn session_mut(&mut self) -> &mut Session

retrieve a mutable reference to the current session

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl SessionConnExt for Conn

source§

fn session(&self) -> &Session

source§

fn with_session(self, key: &str, value: impl Serialize) -> Self

source§

fn session_mut(&mut self) -> &mut Session

Implementors§