pub struct StaticBufferPool<T, const N: usize> { /* private fields */ }Implementations§
Source§impl<T, const N: usize> StaticBufferPool<T, N>
impl<T, const N: usize> StaticBufferPool<T, N>
Sourcepub fn new(buffers: [T; N]) -> Self
pub fn new(buffers: [T; N]) -> Self
Build a pool from N pre-allocated buffers; capacity is fixed at N.
Sourcepub fn outstanding(&self) -> usize
pub fn outstanding(&self) -> usize
Buffers currently checked out (capacity - available).
Sourcepub fn try_acquire(&self) -> Option<StaticPooled<'_, T, N>>
pub fn try_acquire(&self) -> Option<StaticPooled<'_, T, N>>
Try to check out one buffer; None if the pool is exhausted.
Sourcepub fn acquire(&self) -> StaticAcquire<'_, T, N> ⓘ
pub fn acquire(&self) -> StaticAcquire<'_, T, N> ⓘ
Acquire one buffer, awaiting until one is free. Parks a single waiter
(the embedded single-consumer model); use Self::try_acquire for
multi-consumer pools.
Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> !Freeze for StaticBufferPool<T, N>
impl<T, const N: usize> !RefUnwindSafe for StaticBufferPool<T, N>
impl<T, const N: usize> !Sync for StaticBufferPool<T, N>
impl<T, const N: usize> Send for StaticBufferPool<T, N>
impl<T, const N: usize> Unpin for StaticBufferPool<T, N>
impl<T, const N: usize> UnsafeUnpin for StaticBufferPool<T, N>where
RefCell<Inner<T, N>>: UnsafeUnpin,
impl<T, const N: usize> UnwindSafe for StaticBufferPool<T, N>where
RefCell<Inner<T, N>>: UnwindSafe,
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