pub struct ScratchPool { /* private fields */ }Expand description
Pool of fixed-size scratch buffers stored in an arena.
Implementations§
Source§impl ScratchPool
impl ScratchPool
Sourcepub fn new(scratch_size: usize, count: usize) -> ScratchPool
pub fn new(scratch_size: usize, count: usize) -> ScratchPool
Creates a pool of count buffers with scratch_size elements each.
Sourcepub fn get(&self, index: usize) -> Option<ArenaSlice>
pub fn get(&self, index: usize) -> Option<ArenaSlice>
Returns the slice for buffer index, or None if out of bounds.
Sourcepub fn scratch_size(&self) -> usize
pub fn scratch_size(&self) -> usize
Size of each scratch buffer.
Auto Trait Implementations§
impl !Freeze for ScratchPool
impl !RefUnwindSafe for ScratchPool
impl Send for ScratchPool
impl !Sync for ScratchPool
impl Unpin for ScratchPool
impl UnsafeUnpin for ScratchPool
impl UnwindSafe for ScratchPool
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