TwirpHttpService

Trait TwirpHttpService 

Source
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§

Source

type ResponseBody: Body<Error: Error + Send + Sync>

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn ready(&self) -> impl Future<Output = Result<(), Self::Error>> + Send

Source

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.

Implementors§

Source§

impl<S: Service<Request<TwirpRequestBody>, Error: Error + Send + Sync + 'static, Response = Response<RespBody>, Future: Send> + Clone + Send + Sync + 'static, RespBody: Body<Error: Error + Send + Sync + 'static>> TwirpHttpService for S