ResponseHandler

Trait ResponseHandler 

Source
pub trait ResponseHandler {
    type Output;

    const ACCEPT_HEADER: &'static str;

    // Required method
    fn handle_response(
        self,
        response: Response,
    ) -> impl Future<Output = Result<Self::Output>> + Send + Sync;
}
Expand description

Trait for a type that produces a typed response from a successful HTTP response message.

Required Associated Constants§

Source

const ACCEPT_HEADER: &'static str

Accept header added to request.

Required Associated Types§

Source

type Output

Output type.

Required Methods§

Source

fn handle_response( self, response: Response, ) -> impl Future<Output = Result<Self::Output>> + Send + Sync

Consume the response and produce an instance of Output

§Arguments
  • response - Response from API.

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§