pub struct FramePool<'m, const N: usize> { /* private fields */ }Expand description
N equal slots carved from one buffer.
Implementations§
Source§impl<'m, const N: usize> FramePool<'m, N>
impl<'m, const N: usize> FramePool<'m, N>
Sourcepub fn new(buf: &'m mut [u8]) -> Result<Self>
pub fn new(buf: &'m mut [u8]) -> Result<Self>
Split buf into N slots. N must be 1..=255 and each slot at least
one byte; the trailing remainder of buf is unused.
Sourcepub fn free_slots(&self) -> usize
pub fn free_slots(&self) -> usize
Slots not currently acquired.
Sourcepub fn acquire(&mut self) -> Option<SlotId>
pub fn acquire(&mut self) -> Option<SlotId>
Take a free slot, or None when all are in use (a dropped frame, by
policy of the caller — never a block).
Trait Implementations§
Auto Trait Implementations§
impl<'m, const N: usize> !UnwindSafe for FramePool<'m, N>
impl<'m, const N: usize> Freeze for FramePool<'m, N>
impl<'m, const N: usize> RefUnwindSafe for FramePool<'m, N>
impl<'m, const N: usize> Send for FramePool<'m, N>
impl<'m, const N: usize> Sync for FramePool<'m, N>
impl<'m, const N: usize> Unpin for FramePool<'m, N>
impl<'m, const N: usize> UnsafeUnpin for FramePool<'m, N>
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