pub trait Client<CustErr> {
type Request: ClientReq<CustErr> + Send;
type Response: ClientRes<CustErr> + Send;
// Required method
fn send(
req: Self::Request,
) -> impl Future<Output = Result<Self::Response, ServerFnError<CustErr>>> + Send;
}
Expand description
A client defines a pair of request/response types and the logic to send and receive them.
This trait is implemented for things like a browser fetch
request or for
the reqwest
trait. It should almost never be necessary to implement it
yourself, unless you’re trying to use an alternative HTTP crate on the client side.
Required Associated Types§
Required Methods§
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.