Skip to main content

TypedClient

Trait TypedClient 

Source
pub trait TypedClient {
    // Required methods
    fn unary_typed<Req, Res>(
        &self,
        path: &str,
        request: Req,
        options: CallOptions,
    ) -> impl Future<Output = Result<TypedResponse<Res>, Status>>
       where Req: Message,
             Res: Message + Default;
    fn client_streaming_typed<Req, Res, S>(
        &self,
        path: &str,
        requests: S,
        options: CallOptions,
    ) -> impl Future<Output = Result<TypedResponse<Res>, Status>>
       where Req: Message + 'static,
             Res: Message + Default,
             S: Stream<Item = Req> + 'static;
}
Expand description

Typed calls over a Client.

Required Methods§

Source

fn unary_typed<Req, Res>( &self, path: &str, request: Req, options: CallOptions, ) -> impl Future<Output = Result<TypedResponse<Res>, Status>>
where Req: Message, Res: Message + Default,

Unary with prost encode/decode.

Source

fn client_streaming_typed<Req, Res, S>( &self, path: &str, requests: S, options: CallOptions, ) -> impl Future<Output = Result<TypedResponse<Res>, Status>>
where Req: Message + 'static, Res: Message + Default, S: Stream<Item = Req> + 'static,

Client streaming with prost encode/decode.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§