pub trait AsyncMapRequest {
    type Error: Into<Box<dyn Error + Send + Sync>> + 'static;
    type Future: Future<Output = Result<Request, Self::Error>> + Send + 'static;

    // Required methods
    fn name(&self) -> &'static str;
    fn apply(&self, request: Request) -> Self::Future;
}
Expand description

AsyncMapRequest defines an asynchronous middleware that transforms an operation::Request.

Typically, these middleware will read configuration from the PropertyBag and use it to augment the request.

Most fundamental middleware is expressed as AsyncMapRequest’s synchronous cousin, MapRequest, including signing & endpoint resolution. AsyncMapRequest is used for async credential retrieval (e.g., from AWS STS’s AssumeRole operation).

Required Associated Types§

source

type Error: Into<Box<dyn Error + Send + Sync>> + 'static

The type returned when this AsyncMapRequest encounters an error.

source

type Future: Future<Output = Result<Request, Self::Error>> + Send + 'static

The type returned when AsyncMapRequest::apply is called.

Required Methods§

source

fn name(&self) -> &'static str

Returns the name of this map request operation for inclusion in a tracing span.

source

fn apply(&self, request: Request) -> Self::Future

Call this middleware, returning a future that resolves to a request or an error.

Implementors§