pub trait CloseStream {
    // Required method
    fn close(&mut self) -> Result<(), Box<dyn Display>>;
}
Expand description

A trait which custom streams must implement in order to support closing.

Rust’s stdlib has no concept of closing in it, but simply dropping values leads to panics. This trait is therefore required to implement closing.

Required Methods§

source

fn close(&mut self) -> Result<(), Box<dyn Display>>

Implementors§