Trait Finalizable
pub trait Finalizable {
// Required method
fn take_finalizers(&mut self) -> EventFinalizers;
// Provided method
fn take_finalizer_groups(&mut self) -> EventFinalizerGroups { ... }
}Expand description
An object that can be finalized.
Required Methods§
fn take_finalizers(&mut self) -> EventFinalizers
fn take_finalizers(&mut self) -> EventFinalizers
Consumes the finalizers of this object.
Typically used for coalescing the finalizers of multiple items, such as when batching finalizable objects where all finalizations will be processed when the batch itself is processed.
Provided Methods§
fn take_finalizer_groups(&mut self) -> EventFinalizerGroups
fn take_finalizer_groups(&mut self) -> EventFinalizerGroups
Consumes this object’s finalizers while preserving independent finalizer groups.
The default implementation treats this object as a single finalization group. Container types that can later split into independently-finalized events should override this method and return one group per event.