pub struct Session<B> { /* private fields */ }
Available on crate feature
session
only.Expand description
Actual session
Implementations§
source§impl<B> Session<B>where
B: SessionBackend,
impl<B> Session<B>where
B: SessionBackend,
sourcepub async fn set<K, V>(&mut self, key: K, value: &V) -> Result<(), SessionError>
pub async fn set<K, V>(&mut self, key: K, value: &V) -> Result<(), SessionError>
Sets a value for key
sourcepub async fn get<K, O>(&mut self, key: K) -> Result<Option<O>, SessionError>
pub async fn get<K, O>(&mut self, key: K) -> Result<Option<O>, SessionError>
Gets a value for key
Trait Implementations§
source§impl<B> TryFromInput for Session<B>where
B: SessionBackend + Send + 'static,
impl<B> TryFromInput for Session<B>where
B: SessionBackend + Send + 'static,
§type Error = CreateSessionError
type Error = CreateSessionError
An error when conversion failed.
source§async fn try_from_input(
input: HandlerInput
) -> Result<Option<Self>, Self::Error>
async fn try_from_input( input: HandlerInput ) -> Result<Option<Self>, Self::Error>
Performs conversion. Read more
Auto Trait Implementations§
impl<B> Freeze for Session<B>
impl<B> !RefUnwindSafe for Session<B>
impl<B> Send for Session<B>where
B: Send,
impl<B> Sync for Session<B>where
B: Send,
impl<B> Unpin for Session<B>
impl<B> !UnwindSafe for Session<B>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more