pub struct BufferPoolRef { /* private fields */ }Expand description
Cheap, clonable handle to a per-thread buffer pool.
Use BufferPoolRef::acquire to get an OwnedReadBuffer; when the
guard is dropped, the buffer is automatically returned to the pool.
Implementations§
Source§impl BufferPoolRef
impl BufferPoolRef
Sourcepub fn acquire<const CHUNK_SIZE: usize, const INITIAL_CAPACITY: usize>(
&self,
) -> OwnedReadBuffer<CHUNK_SIZE, INITIAL_CAPACITY>
pub fn acquire<const CHUNK_SIZE: usize, const INITIAL_CAPACITY: usize>( &self, ) -> OwnedReadBuffer<CHUNK_SIZE, INITIAL_CAPACITY>
Acquire a buffer from the pool (or allocate a new one) and wrap it in an
RAII guard that returns the buffer on Drop.
Sourcepub fn release<const CHUNK_SIZE: usize, const INITIAL_CAPACITY: usize>(
&self,
buffer: ReadBuffer<CHUNK_SIZE, INITIAL_CAPACITY>,
)
pub fn release<const CHUNK_SIZE: usize, const INITIAL_CAPACITY: usize>( &self, buffer: ReadBuffer<CHUNK_SIZE, INITIAL_CAPACITY>, )
Return a buffer to the pool.
You typically don’t need to call this directly. Dropping
OwnedReadBuffer does it for you.
Trait Implementations§
Source§impl Clone for BufferPoolRef
impl Clone for BufferPoolRef
Source§fn clone(&self) -> BufferPoolRef
fn clone(&self) -> BufferPoolRef
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 moreSource§impl Debug for BufferPoolRef
impl Debug for BufferPoolRef
Source§impl Default for BufferPoolRef
impl Default for BufferPoolRef
Source§fn default() -> BufferPoolRef
fn default() -> BufferPoolRef
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BufferPoolRef
impl !RefUnwindSafe for BufferPoolRef
impl !Send for BufferPoolRef
impl !Sync for BufferPoolRef
impl Unpin for BufferPoolRef
impl UnsafeUnpin for BufferPoolRef
impl !UnwindSafe for BufferPoolRef
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