pub trait AuthScheme: Sized {
    type Input<'a>;
    type AddAuthenticationError: Into<Box<dyn Error + Sync + Send>>;
    type Output;
    type ExtractAuthenticationError: Into<Box<dyn Error + Sync + Send>>;
    // Required methods
    fn add_authentication<T>(
        request: &mut Request<T>,
        input: Self::Input<'_>,
    ) -> Result<(), Self::AddAuthenticationError>
       where T: AsRef<[u8]>;
    fn extract_authentication<T>(
        request: &Request<T>,
    ) -> Result<Self::Output, Self::ExtractAuthenticationError>
       where T: AsRef<[u8]>;
}api only.Expand description
Trait implemented by types representing an authentication scheme used by an endpoint.
Required Associated Types§
Sourcetype AddAuthenticationError: Into<Box<dyn Error + Sync + Send>>
 
type AddAuthenticationError: Into<Box<dyn Error + Sync + Send>>
The error type returned from add_authentication().
Sourcetype ExtractAuthenticationError: Into<Box<dyn Error + Sync + Send>>
 
type ExtractAuthenticationError: Into<Box<dyn Error + Sync + Send>>
The error type returned from extract_authentication().
Required Methods§
Sourcefn add_authentication<T>(
    request: &mut Request<T>,
    input: Self::Input<'_>,
) -> Result<(), Self::AddAuthenticationError>
 
fn add_authentication<T>( request: &mut Request<T>, input: Self::Input<'_>, ) -> Result<(), Self::AddAuthenticationError>
Add this authentication scheme to the given outgoing request, if necessary.
Returns an error if the endpoint requires authentication but the input doesn’t provide it, or if the input fails to serialize to the proper format.
Sourcefn extract_authentication<T>(
    request: &Request<T>,
) -> Result<Self::Output, Self::ExtractAuthenticationError>
 
fn extract_authentication<T>( request: &Request<T>, ) -> Result<Self::Output, Self::ExtractAuthenticationError>
Extract the data of this authentication scheme from the given incoming request.
Returns an error if the endpoint requires authentication but the request doesn’t provide it, or if the output fails to deserialize to the proper format.
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.