pub struct FinalizerStack { /* private fields */ }Expand description
A stack of finalizers with LIFO semantics.
Finalizers are pushed when registered (defer_async/defer_sync) and popped during region finalization. The LIFO ordering ensures resources are released in the reverse order they were acquired.
Implementations§
Source§impl FinalizerStack
impl FinalizerStack
Sourcepub fn with_escalation(escalation: FinalizerEscalation) -> Self
pub fn with_escalation(escalation: FinalizerEscalation) -> Self
Creates a new finalizer stack with the specified escalation policy.
Sourcepub const fn escalation(&self) -> FinalizerEscalation
pub const fn escalation(&self) -> FinalizerEscalation
Returns the escalation policy.
Sourcepub fn push_async<F>(&mut self, future: F)
pub fn push_async<F>(&mut self, future: F)
Pushes an asynchronous finalizer.
Trait Implementations§
Source§impl Debug for FinalizerStack
impl Debug for FinalizerStack
Source§impl Default for FinalizerStack
impl Default for FinalizerStack
Source§fn default() -> FinalizerStack
fn default() -> FinalizerStack
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FinalizerStack
impl !RefUnwindSafe for FinalizerStack
impl Send for FinalizerStack
impl !Sync for FinalizerStack
impl Unpin for FinalizerStack
impl UnsafeUnpin for FinalizerStack
impl !UnwindSafe for FinalizerStack
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).