pub fn to_eio<'b, T, W>(value: &'b T, writer: W) -> Result<W>
Expand description
Serialize a T
to a embedded_io::blocking::Write,
§Example
use postcard::to_eio;
let mut buf: [u8; 32] = [0; 32];
let mut writer: &mut [u8] = &mut buf;
let ser = to_eio(&true, &mut writer).unwrap();
to_eio("Hi!", ser).unwrap();
assert_eq!(&buf[0..5], &[0x01, 0x03, b'H', b'i', b'!']);