serde_cbor::ser

Trait Write

Source
pub trait Write {
    type Error: Into<Error>;

    // Required method
    fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>;
}
Expand description

A sink for serialized CBOR.

This trait is similar to the Write trait in the standard library, but has a smaller and more general API.

Any object implementing std::io::Write can be wrapped in an IoWrite that implements this trait for the underlying object.

This trait is sealed by default, enabling the unsealed_read_write feature removes this bound to allow objects outside of this crate to implement this trait.

Required Associated Types§

Source

type Error: Into<Error>

The type of error returned when a write operation fails.

Required Methods§

Source

fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Attempts to write an entire buffer into this write.

Implementations on Foreign Types§

Source§

impl<W> Write for &mut W
where W: Write,

Source§

type Error = <W as Write>::Error

Source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Implementors§