pub trait Transport: Send + Sync {
// Required method
fn post(&self, body: &[u8]) -> Result<Reply, String>;
}Expand description
The wire: one POST of a JSON request body to the API endpoint.
Client::new builds an HTTPS transport; Client::with_transport
takes any implementation, so tests and local fakes need no network. Err is a connection-level
failure, which the client retries; an HTTP error status is an Ok reply that the client
interprets. The trait is implemented for any Fn(&[u8]) -> Result<Reply, String> closure.
Required Methods§
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".