TakeBuffer

Trait TakeBuffer 

pub trait TakeBuffer {
    type Buffer<'a>;
    type BufferPool;

    // Required method
    fn take_buffer(
        self,
        buffer_pool: &Self::BufferPool,
        result: Result<usize, Error>,
        buffer_id: u16,
    ) -> Result<Self::Buffer<'_>, Error>;
}
Expand description

Trait to get the selected buffer of an io operation.

Required Associated Types§

type Buffer<'a>

Selected buffer type. It keeps the reference to the buffer pool and returns the buffer back on drop.

type BufferPool

Buffer pool type.

Required Methods§

fn take_buffer( self, buffer_pool: &Self::BufferPool, result: Result<usize, Error>, buffer_id: u16, ) -> Result<Self::Buffer<'_>, Error>

Take the selected buffer with buffer_pool, io result and buffer_id, if io operation is success.

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.

Implementors§