pub trait TwirpHttpService: 'static + Send {
type ResponseBody: Body<Error: Error + Send + Sync>;
type Error: Error + Send + Sync + 'static;
// Required methods
fn ready(&self) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn call(
&self,
request: Request<TwirpRequestBody>,
) -> impl Future<Output = Result<Response<Self::ResponseBody>, Self::Error>> + Send;
}
Expand description
A service that can be used to send Twirp requests eg. an HTTP client
Used by TwirpHttpClient
to handle HTTP.
Required Associated Types§
type ResponseBody: Body<Error: Error + Send + Sync>
type Error: Error + Send + Sync + 'static
Required Methods§
fn ready(&self) -> impl Future<Output = Result<(), Self::Error>> + Send
fn call( &self, request: Request<TwirpRequestBody>, ) -> impl Future<Output = Result<Response<Self::ResponseBody>, Self::Error>> + Send
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.