pub struct Pool<T> { /* private fields */ }Expand description
A pool of reusable memory.
Implementations§
Source§impl<T> Pool<T>
impl<T> Pool<T>
Sourcepub fn with_clear<C, D>(create: C, clear: D) -> Pool<T>
pub fn with_clear<C, D>(create: C, clear: D) -> Pool<T>
Create a new Pool from an initializer function and a clear function.
The clear function will be called whenever the ItemGuard is dropped,
and provides an opportunity to clear values and remove potentially
sensitive information from the items before returning it to the memory
pool.
Note that drop in Rust is not guaranteed to run, so this function
is not a replacement for proper security measures.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Pool<T>
impl<T> !RefUnwindSafe for Pool<T>
impl<T> Send for Pool<T>
impl<T> Sync for Pool<T>
impl<T> Unpin for Pool<T>
impl<T> !UnwindSafe for Pool<T>
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