write_native

Function write_native 

Source
pub fn write_native<Wrt, W, T>(writer: &mut Wrt, v: T) -> Result<()>
where Wrt: Write + ?Sized, W: EndianWrite + From<T>,
Available on crate feature io-std only.
Expand description

Convert a native value into its wire representation and write it.

This is the “mirror” of read_native: convert first, then write.

Under the hood this is equivalent to:

let wire: W = value.into();
write_specific(writer, &wire)