pub trait ReadWrite: Clone + Send {
type Type;
// Required methods
fn n_bytes(&self) -> usize;
fn read<R: Read>(&self, reader: &mut R) -> Result<Self::Type, Error>;
fn write<W: Write>(
&self,
writer: &mut W,
val: &Self::Type,
) -> Result<(), Error>;
}
Expand description
Trait used to read and write element of the associated type Type
.
Required Associated Types§
Required 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.