Trait AsyncReadManaged

Source
pub trait AsyncReadManaged {
    type BufferPool;
    type Buffer: IoBuf;

    // Required method
    async fn read_managed(
        &mut self,
        buffer_pool: &Self::BufferPool,
        len: usize,
    ) -> Result<Self::Buffer>;
}
Expand description

§AsyncReadManaged

Async read with buffer pool

Required Associated Types§

Source

type BufferPool

Buffer pool type

Source

type Buffer: IoBuf

Filled buffer type

Required Methods§

Source

async fn read_managed( &mut self, buffer_pool: &Self::BufferPool, len: usize, ) -> Result<Self::Buffer>

Read some bytes from this source with [BufferPool] and return a [Buffer].

If len == 0, will use [BufferPool] inner buffer size as the max len, if len > 0, min(len, inner buffer size) will be the read max len

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<A: AsyncReadManagedAt> AsyncReadManaged for Cursor<A>

Source§

type Buffer = <A as AsyncReadManagedAt>::Buffer

Source§

type BufferPool = <A as AsyncReadManagedAt>::BufferPool

Source§

async fn read_managed( &mut self, buffer_pool: &Self::BufferPool, len: usize, ) -> Result<Self::Buffer>

Implementors§