pub trait StreamOperation {
// Required methods
fn retrieve_from_stream<R>(stream: &mut R) -> Result<Self>
where R: Read,
Self: Sized;
fn write_to_buf<B: BufMut>(&self, buf: &mut B);
fn len(&self) -> usize;
// Provided methods
fn write_to_stream<W: Write>(&self, w: &mut W) -> Result<()> { ... }
fn is_empty(&self) -> bool { ... }
}
Required Methods§
fn retrieve_from_stream<R>(stream: &mut R) -> Result<Self>
fn write_to_buf<B: BufMut>(&self, buf: &mut B)
fn len(&self) -> usize
Provided Methods§
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.