pub trait AsyncReadManaged {
type BufferPool;
type Buffer<'a>;
// Required method
async fn read_managed<'a>(
&mut self,
buffer_pool: &'a Self::BufferPool,
len: usize,
) -> Result<Self::Buffer<'a>>;
}
Expand description
§AsyncReadManaged
Async read with buffer pool
Required Associated Types§
Sourcetype BufferPool
type BufferPool
Buffer pool type
Required Methods§
Sourceasync fn read_managed<'a>(
&mut self,
buffer_pool: &'a Self::BufferPool,
len: usize,
) -> Result<Self::Buffer<'a>>
async fn read_managed<'a>( &mut self, buffer_pool: &'a Self::BufferPool, len: usize, ) -> Result<Self::Buffer<'a>>
Read some bytes from this source with Self::BufferPool
and return
a Self::Buffer
.
If len
== 0, will use Self::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.