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§
Sourcefn send(
&mut self,
item: T,
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + '_>>
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.
Sourcefn is_cancelled(&self) -> bool
fn is_cancelled(&self) -> bool
Check if the stream has been cancelled by the client.