AuthScheme

Trait AuthScheme 

Source
pub trait AuthScheme: Sized {
    type Input<'a>;

    // Required method
    fn add_authentication<T: AsRef<[u8]>>(
        request: &mut Request<T>,
        input: Self::Input<'_>,
    ) -> Result<(), IntoHttpError>;
}
Available on crate feature api only.
Expand description

Trait implemented by types representing an authentication scheme used by an endpoint.

Required Associated Types§

Source

type Input<'a>

The input necessary to generate the authentication.

Required Methods§

Source

fn add_authentication<T: AsRef<[u8]>>( request: &mut Request<T>, input: Self::Input<'_>, ) -> Result<(), IntoHttpError>

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.

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.

Implementors§