pub(in router) trait AuthDispatch: AuthScheme {
const SCHEME: Scheme;
// Required method
fn dispatch(
services: &Services,
request: &mut Request,
json_body: Option<&CanonicalJsonValue>,
token: Token,
route: TypeId,
) -> impl Future<Output = Result<Auth>> + Send;
}Expand description
Trait routing a concrete [AuthScheme] through the per-scheme dispatch.
dispatch is intentionally non-generic over the request type; the
caller passes TypeId::of::<T>() so each impl emits a single body
rather than monomorphizing per request.
Required Associated Constants§
Required Methods§
fn dispatch( services: &Services, request: &mut Request, json_body: Option<&CanonicalJsonValue>, token: Token, route: TypeId, ) -> impl Future<Output = Result<Auth>> + 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.