pub fn to_writer<W, T>(writer: W, value: &T) -> Result<(), Error>where W: Write, T: Serialize,
Encode a value as CBOR to the given writer.