pub struct BufferPool { /* private fields */ }Expand description
A buffer pool.
This type by itself does nothing, and should only be used by *Managed ops.
Implementations§
Source§impl BufferPool
impl BufferPool
Sourcepub fn pop(&self) -> Result<BufferRef>
pub fn pop(&self) -> Result<BufferRef>
Pop an available buffer from the pool with given capacity.
This operation is not supported on io-uring driver and will always
return Unsupported.
Sourcepub fn take(&self, buffer_id: u16) -> Result<Option<BufferRef>>
pub fn take(&self, buffer_id: u16) -> Result<Option<BufferRef>>
Take the indicated buffer from the pool.
Returns None if the buffer is not reset back yet or does not exist.
Sourcepub fn reset(&self, buffer_id: u16) -> Result<bool>
pub fn reset(&self, buffer_id: u16) -> Result<bool>
Reset the buffer_id so that it’s available for kernel to use, return
whether a buffer has been reset.
This is the same as take(buffer_id) and immediately drop it.
Sourcepub fn is_io_uring(&self) -> Result<bool>
Available on fusion only.
pub fn is_io_uring(&self) -> Result<bool>
fusion only.Test if the buffer pool is an io_uring one.
Trait Implementations§
Source§impl Clone for BufferPool
impl Clone for BufferPool
Source§fn clone(&self) -> BufferPool
fn clone(&self) -> BufferPool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BufferPool
impl !RefUnwindSafe for BufferPool
impl !Send for BufferPool
impl !Sync for BufferPool
impl Unpin for BufferPool
impl UnsafeUnpin for BufferPool
impl !UnwindSafe for BufferPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more