pub trait StreamSender: Send + Sync {
// Required methods
fn send_chunk<'life0, 'life1, 'async_trait>(
&'life0 self,
chunk: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn send_json<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_closed(&self) -> bool;
}Expand description
Stream sender for sending chunks
Required Methods§
Sourcefn send_chunk<'life0, 'life1, 'async_trait>(
&'life0 self,
chunk: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_chunk<'life0, 'life1, 'async_trait>(
&'life0 self,
chunk: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a chunk
Sourcefn send_json<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_json<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send JSON chunk
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".