pub struct BufferPool { /* private fields */ }
Expand description
Buffer pool
A buffer pool to allow user no need to specify a specific buffer to do the IO operation
Drop the BufferPool
will release the buffer pool automatically
Implementations§
Source§impl BufferPool
impl BufferPool
Sourcepub fn new(buffer_len: u16, buffer_size: usize) -> Result<Self>
pub fn new(buffer_len: u16, buffer_size: usize) -> Result<Self>
Create buffer pool with given buffer_size
and buffer_len
§Notes
If buffer_len
is not power of 2, it will be upward with
u16::next_power_of_two
Sourcepub fn try_inner(&self) -> Result<&BufferPool>
pub fn try_inner(&self) -> Result<&BufferPool>
Get the inner driver buffer pool reference
§Notes
You should not use this method unless you are writing your own IO opcode
Trait Implementations§
Source§impl Debug for BufferPool
impl Debug for BufferPool
Auto Trait Implementations§
impl !Freeze for BufferPool
impl !RefUnwindSafe for BufferPool
impl !Send for BufferPool
impl !Sync for BufferPool
impl Unpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more