pub trait NpyType: Copy {
const DESCR: &'static str;
const SIZE: usize;
// Required methods
fn write_le(self, buffer: &mut Vec<u8>);
fn read_le(bytes: &[u8]) -> Self;
// Provided methods
fn read_from<R: Read>(file: &mut R, count: usize) -> Result<Vec<Self>> { ... }
fn read_le_all(bytes: &[u8]) -> Vec<Self> { ... }
fn write_le_all<W: Write>(data: &[Self], file: &mut W) -> Result<()> { ... }
fn write_le_bytes(data: &[Self]) -> Vec<u8> ⓘ { ... }
}Required Associated Constants§
Required Methods§
Provided Methods§
fn read_from<R: Read>(file: &mut R, count: usize) -> Result<Vec<Self>>
fn read_le_all(bytes: &[u8]) -> Vec<Self>
fn write_le_all<W: Write>(data: &[Self], file: &mut W) -> Result<()>
fn write_le_bytes(data: &[Self]) -> Vec<u8> ⓘ
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.