pub(super) struct PendingClusters {
clusters_to_free: Arc<ClustersToFreeList>,
entry: Option<ClustersToFreeEntry>,
}Expand description
Guard for newly allocated clusters that are not yet referenced by any metadata.
If the operation that allocated them fails or is cancelled (i.e. its future is dropped) before
it can reference them, dropping this guard enters them into ClustersToFreeList, so they are
not leaked. Once they are referenced (at least in memory), disarm the guard.
Fields§
§clusters_to_free: Arc<ClustersToFreeList>List to enter the clusters into.
entry: Option<ClustersToFreeEntry>The clusters; None when disarmed.
Implementations§
Source§impl PendingClusters
impl PendingClusters
Sourcepub fn cluster(&self) -> HostCluster
pub fn cluster(&self) -> HostCluster
First cluster of the allocation.
Sourcepub fn make_persistent(self)
pub fn make_persistent(self)
Disarm the guard, moving the clusters from a pending state (to be freed when something goes wrong) to a permanent state, because they are referenced now.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PendingClusters
impl !RefUnwindSafe for PendingClusters
impl Send for PendingClusters
impl Sync for PendingClusters
impl Unpin for PendingClusters
impl UnsafeUnpin for PendingClusters
impl !UnwindSafe for PendingClusters
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