pub fn to_writer<T, W>(value: &T, writer: W) -> Result<()>where T: Serialize, W: Write,
Serialize a type into a Writer.