Skip to main content

ClientStreamingHandler

Trait ClientStreamingHandler 

Source
pub trait ClientStreamingHandler<Req, Res>:
    Send
    + Sync
    + 'static
where Req: Message + Send + 'static, Res: Message + Send + 'static,
{ type Body: Encodable<Res> + Send + 'static; // Required method fn call( &self, ctx: RequestContext, requests: ServiceStream<Req>, ) -> BoxFuture<'static, ServiceResult<Self::Body>>; }
Expand description

Trait for client streaming RPC handlers.

Required Associated Types§

Source

type Body: Encodable<Res> + Send + 'static

The response body type. Typically Res.

Required Methods§

Source

fn call( &self, ctx: RequestContext, requests: ServiceStream<Req>, ) -> BoxFuture<'static, ServiceResult<Self::Body>>

Handle a client streaming RPC request.

Implementors§

Source§

impl<F, Fut, Req, Res, B> ClientStreamingHandler<Req, Res> for FnClientStreamingHandler<F>
where F: Fn(RequestContext, ServiceStream<Req>) -> Fut + Send + Sync + 'static, Fut: Future<Output = ServiceResult<B>> + Send + 'static, Req: Message + Send + 'static, Res: Message + Send + 'static, B: Encodable<Res> + Send + 'static,

Source§

type Body = B