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§
sourcefn defer_removal<T: Send + 'static>(
&mut self,
receiver: Self::ReferenceReceiver<T>
)
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§
sourcefn defer_removal_result<T: Send + 'static>(
&mut self,
result: RemoveResourceResultWithContext<T, Self>
)
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.
Object Safety§
This trait is not object safe.