LinkSendStream

Trait LinkSendStream 

Source
pub trait LinkSendStream: Send + Sync {
    // Required methods
    fn write<'a>(
        &'a mut self,
        data: &'a [u8],
    ) -> BoxFuture<'a, LinkResult<usize>>;
    fn write_all<'a>(
        &'a mut self,
        data: &'a [u8],
    ) -> BoxFuture<'a, LinkResult<()>>;
    fn finish(&mut self) -> LinkResult<()>;
    fn reset(&mut self, error_code: u64) -> LinkResult<()>;
    fn id(&self) -> u64;
}
Expand description

A send stream for writing data to a peer.

Required Methods§

Source

fn write<'a>(&'a mut self, data: &'a [u8]) -> BoxFuture<'a, LinkResult<usize>>

Write data to the stream.

Source

fn write_all<'a>(&'a mut self, data: &'a [u8]) -> BoxFuture<'a, LinkResult<()>>

Write all data to the stream.

Source

fn finish(&mut self) -> LinkResult<()>

Finish the stream (signal end of data).

Source

fn reset(&mut self, error_code: u64) -> LinkResult<()>

Reset the stream with an error code.

Source

fn id(&self) -> u64

Get the stream ID.

Implementors§