pub trait AuthExt {
// Required method
fn auth_context<C: Clone + Send + Sync + 'static>(
&self,
) -> Option<&AuthContext<C>>;
// Provided method
fn claims<C: Clone + Send + Sync + 'static>(&self) -> Option<&C> { ... }
}Available on crate features
auth and auth-axum only.Expand description
Extension trait for extracting auth context from request extensions.
Required Methods§
Sourcefn auth_context<C: Clone + Send + Sync + 'static>(
&self,
) -> Option<&AuthContext<C>>
fn auth_context<C: Clone + Send + Sync + 'static>( &self, ) -> Option<&AuthContext<C>>
Get the auth context if present.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<B> AuthExt for Request<B>
impl<B> AuthExt for Request<B>
Source§fn auth_context<C: Clone + Send + Sync + 'static>(
&self,
) -> Option<&AuthContext<C>>
fn auth_context<C: Clone + Send + Sync + 'static>( &self, ) -> Option<&AuthContext<C>>
Available on crate feature
auth-axum only.