Skip to main content

NetBenchReceiveStream

Trait NetBenchReceiveStream 

Source
pub trait NetBenchReceiveStream: Send {
    // Required methods
    fn read<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        bytes: &'life1 mut [u8],
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn read_exact<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        bytes: &'life1 mut [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn cancel(&mut self);
}
Expand description

Receiving half of one host-routed reliable stream.

Required Methods§

Source

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

Reads available bytes, returning zero after the peer finishes.

Source

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

Reads exactly the supplied buffer length.

Source

fn cancel(&mut self)

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

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: NetBenchReceiveStream + ?Sized> NetBenchReceiveStream for Box<T>

Source§

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

Source§

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

Source§

fn cancel(&mut self)

Implementors§