pub struct RefCellBox<T, F, W>{ /* private fields */ }Expand description
Holds a list of allocated objects in a scalable pool. Previously allocated objects can be checked back in after use, to prevent immediate deallocation.
Implementations§
Source§impl<T, F, W> RefCellBox<T, F, W>
impl<T, F, W> RefCellBox<T, F, W>
Sourcepub fn new(
unused_pool: Vec<Box<RefCell<T>>>,
new_gen: F,
grow_size: u8,
washer: W,
) -> RefCellBox<T, F, W>
pub fn new( unused_pool: Vec<Box<RefCell<T>>>, new_gen: F, grow_size: u8, washer: W, ) -> RefCellBox<T, F, W>
Creates a new RefCellBox.
Sourcepub fn unused_pool_size(&self) -> usize
pub fn unused_pool_size(&self) -> usize
Gets the current number of un-checked-out items in the pool. The current “reserve” size.
Sourcepub fn expand(&mut self)
pub fn expand(&mut self)
Grows the RefCellBox pool by the
previously specified quantity.
Trait Implementations§
Auto Trait Implementations§
impl<T, F, W> Freeze for RefCellBox<T, F, W>
impl<T, F, W> !RefUnwindSafe for RefCellBox<T, F, W>
impl<T, F, W> Send for RefCellBox<T, F, W>
impl<T, F, W> !Sync for RefCellBox<T, F, W>
impl<T, F, W> Unpin for RefCellBox<T, F, W>
impl<T, F, W> UnwindSafe for RefCellBox<T, F, W>
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