pub(super) struct ClustersToFreeList {
list: Mutex<Vec<ClustersToFreeEntry>>,
}Expand description
Fields§
§list: Mutex<Vec<ClustersToFreeEntry>>The list itself.
Synchronous mutex because it is never to be held across .await points.
Implementations§
Source§impl ClustersToFreeList
impl ClustersToFreeList
Sourcepub fn push(&self, entry: ClustersToFreeEntry)
pub fn push(&self, entry: ClustersToFreeEntry)
Mark entry as a cluster to be freed.
Sourcepub fn take(&self) -> Vec<ClustersToFreeEntry>
pub fn take(&self) -> Vec<ClustersToFreeEntry>
Remove all entries from the list and return them.
Sourcepub fn pending_guard(
self: &Arc<Self>,
entry: ClustersToFreeEntry,
) -> PendingClusters
pub fn pending_guard( self: &Arc<Self>, entry: ClustersToFreeEntry, ) -> PendingClusters
Create a guard that enters entry into the list when dropped, unless disarmed.
This is for use in allocation paths, where a cluster is allocated, not yet hooked up, and
anything might cause the hooking-up not to happen, in which case entry should be dropped.
Once it is hooked up, the guard will be disarmed, thus making the cluster permanent.
Trait Implementations§
Source§impl Default for ClustersToFreeList
impl Default for ClustersToFreeList
Source§fn default() -> ClustersToFreeList
fn default() -> ClustersToFreeList
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ClustersToFreeList
impl !RefUnwindSafe for ClustersToFreeList
impl Send for ClustersToFreeList
impl Sync for ClustersToFreeList
impl Unpin for ClustersToFreeList
impl UnsafeUnpin for ClustersToFreeList
impl UnwindSafe for ClustersToFreeList
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