pub trait Stream: Send {
// Provided methods
fn read(&mut self, _buf: &mut [u8]) -> Result<usize, IoError> { ... }
fn write(&mut self, _data: &[u8]) -> Result<(), IoError> { ... }
fn flush(&mut self) -> Result<(), IoError> { ... }
fn seek(&mut self, _pos: SeekFrom) -> Result<u64, IoError> { ... }
fn close(&mut self) -> Result<(), IoError> { ... }
}Expand description
A stream a script’s io reads and writes. Each method defaults to C’s failure on a
stream that cannot do it. Calls run inside the script’s call: a stream that blocks holds
the script (fuel and the deadline are not read meanwhile).
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".