Enum gotham_restful::AuthStatus
source · pub enum AuthStatus<T: Send + 'static> {
Unknown,
Unauthenticated,
Invalid(Error),
Authenticated(T),
}
Expand description
The authentication status returned by the auth middleware for each request.
Variants§
Unknown
The auth status is unknown. This is likely because no secret was provided that could be used to verify the token of the client.
Unauthenticated
The request has been performed without any kind of authentication.
Invalid(Error)
The request has been performed with an invalid authentication. This includes expired tokens. Further details can be obtained from the included error.
Authenticated(T)
The request has been performed with a valid authentication. The claims that were decoded from the token are attached.
Implementations§
Trait Implementations§
source§impl<T> Clone for AuthStatus<T>
impl<T> Clone for AuthStatus<T>
impl<T: Send + 'static> StateData for AuthStatus<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for AuthStatus<T>
impl<T> Send for AuthStatus<T>
impl<T> Sync for AuthStatus<T>where
T: Sync,
impl<T> Unpin for AuthStatus<T>where
T: Unpin,
impl<T> !UnwindSafe for AuthStatus<T>
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> FromState for Twhere
T: StateData,
impl<T> FromState for Twhere
T: StateData,
source§fn try_borrow_from(state: &State) -> Option<&T>
fn try_borrow_from(state: &State) -> Option<&T>
Tries to borrow a value from the
State
storage. Read moresource§fn try_borrow_mut_from(state: &mut State) -> Option<&mut T>
fn try_borrow_mut_from(state: &mut State) -> Option<&mut T>
Tries to mutably borrow a value from the
State
storage. Read moresource§fn borrow_mut_from(state: &mut State) -> &mut T
fn borrow_mut_from(state: &mut State) -> &mut T
Mutably borrows a value from the
State
storage. Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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