Skip to main content

Finalizable

Trait Finalizable 

Source
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§

Source

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§

Source

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.

Implementations on Foreign Types§

Source§

impl<T: Finalizable> Finalizable for Vec<T>

Implementors§