Function to_writer
Source pub fn to_writer<T: Serialize, W: Write>(value: &T, writer: W) -> SerResult<()>
Expand description
Serializes rust’s type to bencode using Write trait
§Examples
let mut buf = Vec::<u8>::new(); to_writer(&"abcd", &mut buf)?;
assert_eq!(&buf, b"4:abcd");