pub struct ServiceAuth(pub AuthClaims);Expand description
Extractor that requires the caller to have Service role.
Use on endpoints that only service accounts should access (e.g. register-service):
ⓘ
async fn handler(auth: ServiceAuth, ...) { }Tuple Fields§
§0: AuthClaimsTrait Implementations§
Source§impl Clone for ServiceAuth
impl Clone for ServiceAuth
Source§fn clone(&self) -> ServiceAuth
fn clone(&self) -> ServiceAuth
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServiceAuth
impl Debug for ServiceAuth
Source§impl<S> FromRequestParts<S> for ServiceAuthwhere
S: AuthState,
impl<S> FromRequestParts<S> for ServiceAuthwhere
S: AuthState,
Source§type Rejection = AppError
type Rejection = AppError
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§async fn from_request_parts(
parts: &mut Parts,
state: &S,
) -> Result<ServiceAuth, <ServiceAuth as FromRequestParts<S>>::Rejection>
async fn from_request_parts( parts: &mut Parts, state: &S, ) -> Result<ServiceAuth, <ServiceAuth as FromRequestParts<S>>::Rejection>
Perform the extraction.
Auto Trait Implementations§
impl Freeze for ServiceAuth
impl RefUnwindSafe for ServiceAuth
impl Send for ServiceAuth
impl Sync for ServiceAuth
impl Unpin for ServiceAuth
impl UnsafeUnpin for ServiceAuth
impl UnwindSafe for ServiceAuth
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.