Skip to main content

StreamOnDropExt

Trait StreamOnDropExt 

Source
pub trait StreamOnDropExt: Stream + Sized {
    // Provided method
    fn on_drop<F: FnOnce()>(self, f: F) -> OnDropStream<Self, F> { ... }
}

Provided Methods§

Source

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".

Implementors§