Trait BlockingClient

Source
pub trait BlockingClient:
    Clone
    + Send
    + Sync
    + 'static {
    type Response: BlockingResponse;

    // Required method
    fn request(&self, req: Request) -> Result<Self::Response>;

    // Provided method
    fn describe(&self, f: &mut Formatter<'_>) -> Result { ... }
}
Available on crate feature blocking only.
Expand description

Trait for blocking HTTP clients.

Backend implementations must provide a concrete type that implements this trait to handle blocking HTTP requests.

Required Associated Types§

Source

type Response: BlockingResponse

The type of response returned by this client.

Required Methods§

Source

fn request(&self, req: Request) -> Result<Self::Response>

Sends an HTTP request and returns the response.

Provided Methods§

Source

fn describe(&self, f: &mut Formatter<'_>) -> Result

Provides a textual description of this client.

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§