pub trait DeferredResourceRemovalContext: ReferenceNotifiers {
// Required method
fn defer_removal<T>(&mut self, receiver: Self::ReferenceReceiver<T>)
where T: Send + 'static;
// Provided method
fn defer_removal_result<T>(
&mut self,
result: RemoveResourceResult<T, Self::ReferenceReceiver<T>>,
)
where T: Send + 'static { ... }
}
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>(&mut self, receiver: Self::ReferenceReceiver<T>)where
T: Send + 'static,
fn defer_removal<T>(&mut self, receiver: Self::ReferenceReceiver<T>)where
T: Send + 'static,
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>(
&mut self,
result: RemoveResourceResult<T, Self::ReferenceReceiver<T>>,
)where
T: Send + 'static,
fn defer_removal_result<T>(
&mut self,
result: RemoveResourceResult<T, Self::ReferenceReceiver<T>>,
)where
T: Send + 'static,
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.