pub struct BufferPool { /* private fields */ }Expand description
Fixed-capacity buffer pool with explicit lifecycle transitions.
use wireshift::BufferPool;
let pool = BufferPool::new(1024, 4)?;
let buf = pool.acquire()?;
assert_eq!(buf.capacity(), 1024);Implementations§
Source§impl BufferPool
impl BufferPool
Sourcepub fn registered() -> Result<Self>
pub fn registered() -> Result<Self>
Creates the registered-buffer pool profile used by wireshift’s hot read paths.
This pool eagerly allocates 32 reusable 256 KiB buffers and falls back to standalone heap buffers when all pooled entries are in flight.
Sourcepub fn max_buffers(&self) -> usize
pub fn max_buffers(&self) -> usize
Returns the number of reusable buffers kept in the lock-free queue.
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 (const: unstable) · 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