pub(crate) trait MiddlewareExt:
'static
+ Send
+ Sync {
// Required methods
fn current_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(String, i64)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn renew_token<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, LoginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Implemented by token handlers to expose stored token state and a renewal hook. The middleware owns the coalescing decision under the MiddlewareWrapper mutex.
Required Methods§
Sourcefn current_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(String, i64)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn current_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(String, i64)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the stored access token and its expiration timestamp (Unix seconds), or None if
no token state is available.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".