pub struct Session<User> { /* private fields */ }Expand description
An authenticated session for a user.
Sessions are created by Authentication::login,
inserted into request extensions by the authentication middleware, and can be
extracted by Axum handlers when the axum feature is enabled.
Implementations§
Trait Implementations§
impl<User> Eq for Session<User>
Source§impl<S, User> FromRequestParts<S> for Session<User>
Available on crate feature axum only.
impl<S, User> FromRequestParts<S> for Session<User>
Available on crate feature
axum only.Source§impl<User> IntoResponseParts for Session<User>
Available on crate feature axum only.
impl<User> IntoResponseParts for Session<User>
Available on crate feature
axum only.Source§type Error = Infallible
type Error = Infallible
The type returned in the event of an error. Read more
Source§fn into_response_parts(
self,
res: ResponseParts,
) -> Result<ResponseParts, Self::Error>
fn into_response_parts( self, res: ResponseParts, ) -> Result<ResponseParts, Self::Error>
Set parts of the response
Source§impl<S, User> OptionalFromRequestParts<S> for Session<User>
Available on crate feature axum only.
impl<S, User> OptionalFromRequestParts<S> for Session<User>
Available on crate feature
axum only.Auto Trait Implementations§
impl<User> Freeze for Session<User>
impl<User> RefUnwindSafe for Session<User>where
User: RefUnwindSafe,
impl<User> Send for Session<User>
impl<User> Sync for Session<User>
impl<User> Unpin for Session<User>
impl<User> UnsafeUnpin for Session<User>
impl<User> UnwindSafe for Session<User>where
User: RefUnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
Perform the extraction.
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