Skip to main content

Authenticator

Trait Authenticator 

Source
pub trait Authenticator: Send + Sync {
    // Required method
    fn sign(
        &self,
        parts: &mut RequestParts,
        attempt: u32,
    ) -> impl Future<Output = Result<(), ApiError>> + Send;
}
Expand description

Signs an attempt before it is sent.

Required Methods§

Source

fn sign( &self, parts: &mut RequestParts, attempt: u32, ) -> impl Future<Output = Result<(), ApiError>> + Send

Sign parts, adding headers or query parameters. Runs on every attempt, so a timestamp in the signature is fresh each time.

§Errors

The ApiError the signing failed with. The request is not sent.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<DYNOSAUR> Authenticator for &DYNOSAUR
where DYNOSAUR: ?Sized + Authenticator, Self: Send + Sync,

Source§

fn sign( &self, parts: &mut RequestParts, attempt: u32, ) -> impl Future<Output = Result<(), ApiError>> + Send

Source§

impl<DYNOSAUR> Authenticator for &mut DYNOSAUR
where DYNOSAUR: ?Sized + Authenticator, Self: Send + Sync,

Source§

fn sign( &self, parts: &mut RequestParts, attempt: u32, ) -> impl Future<Output = Result<(), ApiError>> + Send

Source§

impl<DYNOSAUR> Authenticator for Box<DYNOSAUR>
where DYNOSAUR: ?Sized + Authenticator, Self: Send + Sync,

Source§

fn sign( &self, parts: &mut RequestParts, attempt: u32, ) -> impl Future<Output = Result<(), ApiError>> + Send

Implementors§

Source§

impl<'dynosaur_struct> Authenticator for DynAuthenticator<'dynosaur_struct>