pub struct UserAuthorization<F = ()> { /* private fields */ }
Implementations§
source§impl<F: Send> UserAuthorization<F>
impl<F: Send> UserAuthorization<F>
sourcepub async fn protected_form<E>(
self,
repo: &mut impl RepositoryAccess<Error = E>,
clock: &impl Clock,
) -> Result<(Session, F), AuthorizationVerificationError<E>>
pub async fn protected_form<E>( self, repo: &mut impl RepositoryAccess<Error = E>, clock: &impl Clock, ) -> Result<(Session, F), AuthorizationVerificationError<E>>
Verify a user authorization and return the session and the protected form value
§Errors
Returns an error if the token is invalid, if the user session ended or if the form is missing
sourcepub async fn protected<E>(
self,
repo: &mut impl RepositoryAccess<Error = E>,
clock: &impl Clock,
) -> Result<Session, AuthorizationVerificationError<E>>
pub async fn protected<E>( self, repo: &mut impl RepositoryAccess<Error = E>, clock: &impl Clock, ) -> Result<Session, AuthorizationVerificationError<E>>
Verify a user authorization and return the session
§Errors
Returns an error if the token is invalid or if the user session ended
Trait Implementations§
source§impl<F: Debug> Debug for UserAuthorization<F>
impl<F: Debug> Debug for UserAuthorization<F>
source§impl<S, F> FromRequest<S> for UserAuthorization<F>
impl<S, F> FromRequest<S> for UserAuthorization<F>
source§type Rejection = UserAuthorizationError
type Rejection = UserAuthorizationError
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Auto Trait Implementations§
impl<F> Freeze for UserAuthorization<F>where
F: Freeze,
impl<F> RefUnwindSafe for UserAuthorization<F>where
F: RefUnwindSafe,
impl<F> Send for UserAuthorization<F>where
F: Send,
impl<F> Sync for UserAuthorization<F>where
F: Sync,
impl<F> Unpin for UserAuthorization<F>where
F: Unpin,
impl<F> UnwindSafe for UserAuthorization<F>where
F: UnwindSafe,
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> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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