pub struct AuthenticatorMiddleware { /* private fields */ }Expand description
Middleware for token authentication.
Note that in order to use this, you need to add ClientWithMiddleware as an extension
to your requests.
Implementations§
Source§impl AuthenticatorMiddleware
impl AuthenticatorMiddleware
Sourcepub fn new(authenticator: AuthHeaderManager) -> Result<Self>
pub fn new(authenticator: AuthHeaderManager) -> Result<Self>
Create a new authenticator middleware from an authenticator.
§Arguments
authenticator- Header manager.
Trait Implementations§
Source§impl Middleware for AuthenticatorMiddleware
impl Middleware for AuthenticatorMiddleware
Source§fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: Request,
extensions: &'life1 mut Extensions,
next: Next<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: Request,
extensions: &'life1 mut Extensions,
next: Next<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Invoked with a request before sending it. If you want to continue processing the request,
you should explicitly call
next.run(req, extensions). Read moreAuto Trait Implementations§
impl Freeze for AuthenticatorMiddleware
impl !RefUnwindSafe for AuthenticatorMiddleware
impl Send for AuthenticatorMiddleware
impl Sync for AuthenticatorMiddleware
impl Unpin for AuthenticatorMiddleware
impl !UnwindSafe for AuthenticatorMiddleware
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