pub struct WsAuth<U>(pub U)
where
U: Send + Sync + 'static;Expand description
The generic WebSocket authentication extractor.
This extractor requires the request to be authenticated. It holds the validated
user object of type U. If authentication fails, the request is rejected with
Tuple Fields§
§0: UTrait Implementations§
Source§impl<S, U> FromRequestParts<S> for WsAuth<U>
impl<S, U> FromRequestParts<S> for WsAuth<U>
Source§type Rejection = Response<Body>
type Rejection = Response<Body>
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_parts(
parts: &mut Parts,
state: &S,
) -> impl Future<Output = Result<Self, <Self as FromRequestParts<S>>::Rejection>> + Send
fn from_request_parts( parts: &mut Parts, state: &S, ) -> impl Future<Output = Result<Self, <Self as FromRequestParts<S>>::Rejection>> + Send
Perform the extraction.
Auto Trait Implementations§
impl<U> Freeze for WsAuth<U>where
U: Freeze,
impl<U> RefUnwindSafe for WsAuth<U>where
U: RefUnwindSafe,
impl<U> Send for WsAuth<U>
impl<U> Sync for WsAuth<U>
impl<U> Unpin for WsAuth<U>where
U: Unpin,
impl<U> UnwindSafe for WsAuth<U>where
U: 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<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.