Trait W

Source
pub trait W: Write {
    // Required method
    fn w<T: Writable>(&mut self, data: T) -> Result<()>;
}
Expand description

Write little endian (commonly native) data.

let mut wtr = Vec::new();
wtr.w::<[u32; 2]>([267, 1205419366]).unwrap();
assert_eq!(wtr, [11, 1, 0, 0, 102, 61, 217, 71]);

Required Methods§

Source

fn w<T: Writable>(&mut self, data: T) -> Result<()>

Writes a type to a Writer

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.

Implementors§