ToWrite

Trait ToWrite 

Source
pub trait ToWrite {
    // Required method
    fn copy_to_write(&self, writer: &mut dyn Write) -> Result<()>;
}
Expand description

This trait can be used by all structs that can be serialized to a Write.

I would not recommend using this if you have control over the serialization and only want to use this for rust<->rust serialization. Serde is better for this purpose. This is useful for use cases where precise control of how the data is written is required.

Example: Image Encoding, Network Packet encoding,…

Required Methods§

Source

fn copy_to_write(&self, writer: &mut dyn Write) -> Result<()>

Implementors§