pub struct Memory { /* private fields */ }
Expand description
Container of shared memory blocks.
Does not automatically de-allocate memory!
Call cleanup
method to de-allocate when it is the most convenient.
Implementations§
Source§impl Memory
impl Memory
pub fn builder() -> MemoryBuilder
pub fn new() -> Memory
Sourcepub fn cleanup(&self) -> usize
pub fn cleanup(&self) -> usize
Cleans up the memory and returns cleaned-up memory size if the amount of free blocks is
above max
.
pub fn take_block(&mut self) -> Box<[u8]>
pub fn return_block(&mut self, block: Box<[u8]>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Memory
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnwindSafe for Memory
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