pub struct TokenGuard<U: Authenticatable> { /* private fields */ }Expand description
Authenticates by Authorization: Bearer ….
Stateless: nothing is stored, so there is nothing to log out of. Revoking a token means changing it on the user row.
Implementations§
Source§impl<U: Authenticatable> TokenGuard<U>
impl<U: Authenticatable> TokenGuard<U>
Trait Implementations§
Auto Trait Implementations§
impl<U> !RefUnwindSafe for TokenGuard<U>
impl<U> !UnwindSafe for TokenGuard<U>
impl<U> Freeze for TokenGuard<U>
impl<U> Send for TokenGuard<U>
impl<U> Sync for TokenGuard<U>
impl<U> Unpin for TokenGuard<U>
impl<U> UnsafeUnpin for TokenGuard<U>
Blanket Implementations§
impl<T> Actor for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Event for T
impl<T> Event for T
Source§fn event_name() -> &'static strwhere
Self: Sized,
fn event_name() -> &'static strwhere
Self: Sized,
A human-readable name, used by wildcard listeners and log output.
Always the Rust type path; see the trait docs.
Source§impl<U, G> GuardExt<U> for G
impl<U, G> GuardExt<U> for G
Source§fn check<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Whether the request is authenticated.
Source§fn guest<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn guest<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Whether the request is not authenticated.