pub struct MemoryLock { /* private fields */ }
Expand description
A set of storage buffers that are ‘locked’ and cannot be used for allocations currently.
Implementations§
Source§impl MemoryLock
impl MemoryLock
Sourcepub fn new(flush_threshold: usize) -> Self
pub fn new(flush_threshold: usize) -> Self
Create a new memory lock with the given flushing threshold.
Sourcepub fn is_locked(&self, storage: &StorageId) -> bool
pub fn is_locked(&self, storage: &StorageId) -> bool
Check whether a particular storage ID is locked currently.
Sourcepub fn has_reached_threshold(&self) -> bool
pub fn has_reached_threshold(&self) -> bool
Whether the flushing threshold has been reached.
Sourcepub fn add_locked(&mut self, storage: StorageId)
pub fn add_locked(&mut self, storage: StorageId)
Add a storage ID to be locked.
Sourcepub fn clear_locked(&mut self)
pub fn clear_locked(&mut self)
Remove all locks at once.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoryLock
impl RefUnwindSafe for MemoryLock
impl Send for MemoryLock
impl Sync for MemoryLock
impl Unpin for MemoryLock
impl UnwindSafe for MemoryLock
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