[−][src]Struct actix_sled_session::SledSession
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]
db: Db,
name: &str,
secure: bool,
key: &[u8],
expiry: Option<Duration>
) -> Result<Self, Error>
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]
fn clone(&self) -> SledSession
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S, B: 'static> Transform<S> for SledSession where
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
[src]
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
S::Future: 'static,
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.
fn new_transform(&self, service: S) -> Self::Future
[src]
fn map_init_err<F, E>(self, f: F) -> TransformMapInitErr<Self, S, F, E> where
F: Fn(Self::InitError) -> E,
F: Fn(Self::InitError) -> E,
fn from_err<E>(self) -> TransformFromErr<Self, S, E> where
E: From<Self::InitError>,
E: From<Self::InitError>,
Auto Trait Implementations
impl Send for SledSession
impl Unpin for SledSession
impl Sync for SledSession
impl !UnwindSafe for SledSession
impl !RefUnwindSafe for SledSession
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, S> IntoTransform<T, S> for T where
T: Transform<S>,
T: Transform<S>,
fn into_transform(self) -> T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,