Struct gotham::middleware::session::MemoryBackend [−][src]
pub struct MemoryBackend { /* fields omitted */ }
Expand description
Defines the in-process memory based session storage.
This is the default implementation which is used by NewSessionMiddleware::default()
Implementations
Creates a new MemoryBackend
where sessions expire and are removed after the ttl
has
elapsed.
Alternately, MemoryBackend::default()
creates a MemoryBackend
with a ttl
of one hour.
Examples
NewSessionMiddleware::new(MemoryBackend::new(Duration::from_secs(3600)))
Trait Implementations
fn persist_session(
&self,
_: &State,
identifier: SessionIdentifier,
content: &[u8]
) -> Pin<Box<SetSessionFuture>>
fn persist_session(
&self,
_: &State,
identifier: SessionIdentifier,
content: &[u8]
) -> Pin<Box<SetSessionFuture>>
Persists a session, either creating a new session or updating an existing session.
fn read_session(
&self,
_: &State,
identifier: SessionIdentifier
) -> Pin<Box<GetSessionFuture>>
fn read_session(
&self,
_: &State,
identifier: SessionIdentifier
) -> Pin<Box<GetSessionFuture>>
Retrieves a session from the underlying storage. Read more
fn drop_session(
&self,
_: &State,
identifier: SessionIdentifier
) -> Pin<Box<SetSessionFuture>>
fn drop_session(
&self,
_: &State,
identifier: SessionIdentifier
) -> Pin<Box<SetSessionFuture>>
Drops a session from the underlying storage.
Returns the “default value” for a type. Read more
type Instance = MemoryBackend
type Instance = MemoryBackend
The type of Backend
created by the NewBackend
.
Create and return a new Backend
value.
Auto Trait Implementations
impl RefUnwindSafe for MemoryBackend
impl Send for MemoryBackend
impl Sync for MemoryBackend
impl Unpin for MemoryBackend
impl UnwindSafe for MemoryBackend
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more