[][src]Struct actix_sled_session::SledSession

pub struct SledSession { /* fields omitted */ }

The session middleware

This struct must be passed into a .wrap method when constructing an Actix Web App

Methods

impl SledSession[src]

pub fn new(
    db: Db,
    name: &str,
    secure: bool,
    key: &[u8],
    expiry: Option<Duration>
) -> Result<Self, Error>
[src]

Create a new middleware with the provided sled database

The provided name is used to open the session tree and set the session cookie The key is used to encrypt the session cookie The secure flag determines whether the cookie must be sent over HTTPS Expiry sets how long the items in the session cache are valid for

pub fn new_default() -> Result<Self, Error>[src]

Create a new default middleware backed by a temporary, compressed sled database

The defaultlt expiry is set to 7 days, and the frequency check is also set to 7 days. This means session data can be valid betwen 7 and 14 days. the Secure flag defaults to false The cookie's key is generated randomly

Trait Implementations

impl Clone for SledSession[src]

impl<S, B: 'static> Transform<S> for SledSession where
    S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
    S::Future: 'static, 
[src]

type Request = ServiceRequest

Requests handled by the service.

type Response = ServiceResponse<B>

Responses given by the service.

type Error = Error

Errors produced by the service.

type InitError = ()

Errors produced while building a service.

type Transform = SledSessionMiddleware<S>

The TransformService value created by this factory

type Future = FutureResult<Self::Transform, Self::InitError>

The future response value.

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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> Erased for T

impl<T, S> IntoTransform<T, S> for T where
    T: Transform<S>, 

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