pub trait Stream:
Read
+ Write
+ Seek {
// Required methods
fn position(&self) -> Result<u64>;
fn eof(&self) -> bool;
fn errno(&self) -> i32;
fn last_error(&self) -> Option<Error>;
fn clear_error(&self);
fn file_name(&self) -> Result<PathBuf>;
fn metadata(&self) -> Result<Metadata>;
fn read_slice<T: Sized>(&mut self, elements: &mut [T]) -> Result<usize>;
fn write_slice<T: Sized>(&mut self, elements: &[T]) -> Result<usize>;
}
Expand description
The C *FILE stream
Required Methods§
Sourcefn last_error(&self) -> Option<Error>
fn last_error(&self) -> Option<Error>
get the last error of the stream
Sourcefn clear_error(&self)
fn clear_error(&self)
clears the end-of-file and error indicators for the stream
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.