pub struct RefreshSession<T> {
pub session_id: Uuid,
pub data: T,
}Expand description
Extractor that requires a valid refresh token.
This extractor validates the refresh token from either:
- The
X-Refresh-Tokenheader - The
Authorizationheader withBearerprefix
If a valid refresh token is provided, the session is loaded. This is useful for sensitive operations that require extra authentication.
Fields§
§session_id: Uuid§data: TTrait Implementations§
Source§impl<S, R, T> FromRequestParts<AuthState<S, R>> for RefreshSession<T>
impl<S, R, T> FromRequestParts<AuthState<S, R>> for RefreshSession<T>
Auto Trait Implementations§
impl<T> Freeze for RefreshSession<T>where
T: Freeze,
impl<T> RefUnwindSafe for RefreshSession<T>where
T: RefUnwindSafe,
impl<T> Send for RefreshSession<T>where
T: Send,
impl<T> Sync for RefreshSession<T>where
T: Sync,
impl<T> Unpin for RefreshSession<T>where
T: Unpin,
impl<T> UnwindSafe for RefreshSession<T>where
T: 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.