pub enum AllocationReleaseOutcome {
Complete {
accounting: ReleaseAccounting,
},
Quarantined {
accounting: ReleaseAccounting,
residual: ResidualOwnership,
},
Failed {
failure: ReleaseFailure,
},
}Expand description
The structured result of one whole-allocation release.
Variants§
Complete
The allocation was fully released (freed or pooled). accounting
reports the refund, and zero unmapped bytes is a valid complete result.
Fields
§
accounting: ReleaseAccountingQuarantined
Ownership was retained. accounting reports whatever was actually
unmapped before stopping, and residual reports what is still owned.
Failed
Nothing was mutated. Only an allocator may produce this; the binding
layer converts it to Quarantined when the live record is already gone.
Fields
§
failure: ReleaseFailureImplementations§
Source§impl AllocationReleaseOutcome
impl AllocationReleaseOutcome
pub const fn complete(accounting: ReleaseAccounting) -> Self
pub const fn quarantined( accounting: ReleaseAccounting, residual: ResidualOwnership, ) -> Self
pub fn failed(reason: impl Into<Arc<str>>) -> Self
Sourcepub const fn state(&self) -> AllocationReleaseState
pub const fn state(&self) -> AllocationReleaseState
The lifecycle state this outcome leaves the allocation in.
pub const fn accounting(&self) -> Option<ReleaseAccounting>
pub const fn residual(&self) -> Option<ResidualOwnership>
pub const fn failure(&self) -> Option<&ReleaseFailure>
pub const fn is_complete(&self) -> bool
pub const fn is_quarantined(&self) -> bool
Sourcepub const fn unmapped_bytes(&self) -> u64
pub const fn unmapped_bytes(&self) -> u64
Unmapped bytes, or zero when nothing was mutated.
Trait Implementations§
Source§impl Clone for AllocationReleaseOutcome
impl Clone for AllocationReleaseOutcome
Source§fn clone(&self) -> AllocationReleaseOutcome
fn clone(&self) -> AllocationReleaseOutcome
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AllocationReleaseOutcome
impl Debug for AllocationReleaseOutcome
impl Eq for AllocationReleaseOutcome
Source§impl PartialEq for AllocationReleaseOutcome
impl PartialEq for AllocationReleaseOutcome
impl StructuralPartialEq for AllocationReleaseOutcome
Auto Trait Implementations§
impl Freeze for AllocationReleaseOutcome
impl RefUnwindSafe for AllocationReleaseOutcome
impl Send for AllocationReleaseOutcome
impl Sync for AllocationReleaseOutcome
impl Unpin for AllocationReleaseOutcome
impl UnsafeUnpin for AllocationReleaseOutcome
impl UnwindSafe for AllocationReleaseOutcome
Blanket Implementations§
impl<T> BindingResource for T
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