pub struct VecPool { /* private fields */ }Expand description
A simple frame pool backed by a Vec of reusable buffers.
Stores up to capacity buffers and returns them to callers via
FramePool::acquire. When exhausted, acquire returns None and
the caller allocates a new buffer directly.
§Thread Safety
All access is protected by a Mutex, making VecPool safe to share
across threads via Arc<VecPool>.
§Examples
use ff_common::VecPool;
let pool = VecPool::new(32);
assert_eq!(pool.available(), 0); // pool starts emptyImplementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for VecPool
impl RefUnwindSafe for VecPool
impl Send for VecPool
impl Sync for VecPool
impl Unpin for VecPool
impl UnsafeUnpin for VecPool
impl UnwindSafe for VecPool
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