pub struct HeapBufferPool { /* private fields */ }Implementations§
Methods from Deref<Target = BufferPool>§
Sourcepub fn total_buffer_count(&self) -> usize
pub fn total_buffer_count(&self) -> usize
Get the total number of buffers from this pool that are in circulation.
Sourcepub fn buffer_size(&self) -> usize
pub fn buffer_size(&self) -> usize
Get the size in bytes of each buffer in this pool.
pub fn buffer_by_id(&self, id: u32) -> BufferPtr
Sourcepub fn register_thread(&self) -> BufferPoolThreadGuard<'_>
pub fn register_thread(&self) -> BufferPoolThreadGuard<'_>
Register the current thread as a known user of buffers until the returned guard object is dropped. This is purely an optimization and is optional to do. It prevents an atomic reference count from being unnecessarily incremented and decremented when buffers are received and released by this thread.
pub async fn acquire(&self) -> BufferPtr
pub fn try_acquire(&self) -> Option<BufferPtr>
pub unsafe fn release(&self, buffer: BufferPtr)
Trait Implementations§
Source§impl Clone for HeapBufferPool
impl Clone for HeapBufferPool
Source§fn clone(&self) -> HeapBufferPool
fn clone(&self) -> HeapBufferPool
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 Deref for HeapBufferPool
impl Deref for HeapBufferPool
Source§type Target = BufferPool
type Target = BufferPool
The resulting type after dereferencing.
Source§impl Drop for HeapBufferPool
impl Drop for HeapBufferPool
impl Send for HeapBufferPool
impl Sync for HeapBufferPool
Auto Trait Implementations§
impl Freeze for HeapBufferPool
impl !RefUnwindSafe for HeapBufferPool
impl Unpin for HeapBufferPool
impl !UnwindSafe for HeapBufferPool
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