StreamSink

Trait StreamSink 

Source
pub trait StreamSink<T>: Send {
    // Required methods
    fn send(
        &mut self,
        item: T,
    ) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + '_>>;
    fn is_cancelled(&self) -> bool;
}
Expand description

A sink for sending streaming items from server to client.

This is an internal building block. For service trait definitions, use Streaming<T> as the return type instead.

Required Methods§

Source

fn send( &mut self, item: T, ) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + '_>>

Send an item to the client.

Returns Err if the channel was cancelled or an error occurred.

Source

fn is_cancelled(&self) -> bool

Check if the stream has been cancelled by the client.

Implementors§