netstack3_base

Trait DeferredResourceRemovalContext

Source
pub trait DeferredResourceRemovalContext: ReferenceNotifiers {
    // Required method
    fn defer_removal<T: Send + 'static>(
        &mut self,
        receiver: Self::ReferenceReceiver<T>,
    );

    // Provided method
    fn defer_removal_result<T: Send + 'static>(
        &mut self,
        result: RemoveResourceResultWithContext<T, Self>,
    ) { ... }
}
Expand description

A context trait that allows core to defer observing proper resource cleanup to bindings.

This trait exists as a debug utility to expose resources that are not removed from the system as expected.

Required Methods§

Source

fn defer_removal<T: Send + 'static>( &mut self, receiver: Self::ReferenceReceiver<T>, )

Defers the removal of some resource T to bindings.

Bindings can watch receiver and notify when resource removal is not completing in a timely manner.

Provided Methods§

Source

fn defer_removal_result<T: Send + 'static>( &mut self, result: RemoveResourceResultWithContext<T, Self>, )

A shorthand for [defer_removal] that takes a ReferenceReceiver from the Deferred variant of a RemoveResourceResult.

The default implementation is track_caller when the instrumented feature is available so implementers can track the caller location when needed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§