pub trait GuardStreamExt: Stream + Sized {
// Required method
fn guard<F>(self, on_drop: F) -> StreamGuard<Self, F>
where F: FnOnce();
}Expand description
A convenience extension for creating a StreamGuard via a method.
Required Methods§
Sourcefn guard<F>(self, on_drop: F) -> StreamGuard<Self, F>where
F: FnOnce(),
fn guard<F>(self, on_drop: F) -> StreamGuard<Self, F>where
F: FnOnce(),
Wraps the Stream, running the given closure upon being 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.