pub struct AuthExtension {
pub user: UserContext,
/* private fields */
}Expand description
Extension for accessing UserContext in handlers
Fields§
§user: UserContextImplementations§
Source§impl AuthExtension
impl AuthExtension
Sourcepub fn user(&self) -> &UserContext
pub fn user(&self) -> &UserContext
Get the user context
Sourcepub fn user_mut(&mut self) -> &mut UserContext
pub fn user_mut(&mut self) -> &mut UserContext
Get mutable user context
Trait Implementations§
Source§impl Clone for AuthExtension
impl Clone for AuthExtension
Source§fn clone(&self) -> AuthExtension
fn clone(&self) -> AuthExtension
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthExtension
impl Debug for AuthExtension
Source§impl<S> FromRequestParts<S> for AuthExtension
Extractor for UserContext from request
impl<S> FromRequestParts<S> for AuthExtension
Extractor for UserContext from request
Auto Trait Implementations§
impl Freeze for AuthExtension
impl RefUnwindSafe for AuthExtension
impl Send for AuthExtension
impl Sync for AuthExtension
impl Unpin for AuthExtension
impl UnwindSafe for AuthExtension
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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.