pub trait AuthHandler<Auth, Args>:
Clone
+ Send
+ Sync
+ 'static {
// Required method
fn call(
self,
parts: Parts,
body: Bytes,
) -> Pin<Box<dyn Future<Output = Response<BoxBody>> + Send>>;
}Expand description
A handler that takes Auth as its first argument.
This is separate from Handler<Args> to ensure that Protected
endpoints can only be bound with handlers that accept the auth type.
The trait is implemented for async functions where the first argument
is Auth: FromRequestParts.
Required Methods§
fn call( self, parts: Parts, body: Bytes, ) -> Pin<Box<dyn Future<Output = Response<BoxBody>> + Send>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.