pub trait ViewStreamingHandler<ReqView, Res>:
Send
+ Sync
+ 'static{
type Item: Encodable<Res> + Send + 'static;
// Required method
fn call(
&self,
ctx: RequestContext,
request: OwnedView<ReqView>,
) -> BoxFuture<'static, ServiceResult<ServiceStream<Self::Item>>>;
}Expand description
Trait for server streaming RPC handlers using zero-copy request views.
Required Associated Types§
Sourcetype Item: Encodable<Res> + Send + 'static
type Item: Encodable<Res> + Send + 'static
The stream item type. Typically Res itself; may be
PreEncoded or
MaybeBorrowed for handlers that encode
borrowing views per item.
Required Methods§
Sourcefn call(
&self,
ctx: RequestContext,
request: OwnedView<ReqView>,
) -> BoxFuture<'static, ServiceResult<ServiceStream<Self::Item>>>
fn call( &self, ctx: RequestContext, request: OwnedView<ReqView>, ) -> BoxFuture<'static, ServiceResult<ServiceStream<Self::Item>>>
Handle a server streaming RPC request with a zero-copy view.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".