pub trait StreamOnDropExt: Stream + Sized {
// Provided method
fn on_drop<F: FnOnce()>(self, f: F) -> OnDropStream<Self, F> { ... }
}Provided Methods§
Sourcefn on_drop<F: FnOnce()>(self, f: F) -> OnDropStream<Self, F>
fn on_drop<F: FnOnce()>(self, f: F) -> OnDropStream<Self, F>
Wrap this stream so that f is called when the stream is dropped.
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.