Skip to main content

NetBenchSendStream

Trait NetBenchSendStream 

Source
pub trait NetBenchSendStream: Send {
    // Required methods
    fn write_all<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        bytes: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn finish(&mut self) -> Result<()>;
    fn cancel(&mut self);

    // Provided method
    fn write<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        bytes: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Sending half of one host-routed reliable stream.

Required Methods§

Source

fn write_all<'life0, 'life1, 'async_trait>( &'life0 mut self, bytes: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Writes the complete buffer.

Source

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

Finishes the sending half without closing the host session.

§Errors

Returns the host adapter’s flow-local stream error.

Source

fn cancel(&mut self)

Cancels this stream’s pending write without closing the host session.

Provided Methods§

Source

fn write<'life0, 'life1, 'async_trait>( &'life0 mut self, bytes: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Writes one buffer and returns its complete length.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: NetBenchSendStream + ?Sized> NetBenchSendStream for Box<T>

Source§

fn write<'life0, 'life1, 'async_trait>( &'life0 mut self, bytes: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn write_all<'life0, 'life1, 'async_trait>( &'life0 mut self, bytes: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

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

Source§

fn cancel(&mut self)

Implementors§