pub trait StreamObserver {
// Provided methods
fn on_read(&mut self, _filled: usize) { ... }
fn on_write(
&mut self,
_cx: &mut Context<'_>,
result: Poll<Result<usize>>,
) -> Poll<Result<usize>> { ... }
fn on_flush(
&mut self,
_cx: &mut Context<'_>,
result: Poll<Result<()>>,
) -> Poll<Result<()>> { ... }
}Expand description
What an ObservedStream reports to.
Each method sees one poll of the wrapped stream and, for a write, flush or shutdown, returns what the caller gets. The defaults pass every outcome on unchanged.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".