serde::ser

Trait BytesSerializer

source
pub trait BytesSerializer {
    type Ok;
    type Err: Error;

    // Required methods
    fn serialize_bytes<T: Serialize>(
        &mut self,
        buf: &[u8],
    ) -> Result<(), Self::Err>;
    fn end(self) -> Result<Self::Ok, Self::Err>;
}
Expand description

Serializes a stream of bytes.

Required Associated Types§

Required Methods§

source

fn serialize_bytes<T: Serialize>(&mut self, buf: &[u8]) -> Result<(), Self::Err>

Serialize the next chunk of bytes.

source

fn end(self) -> Result<Self::Ok, Self::Err>

Finishes the serialization.

Object Safety§

This trait is not object safe.

Implementors§