CborArrayEncoder

Trait CborArrayEncoder 

Source
pub trait CborArrayEncoder {
    // Required methods
    fn serialize_element<T>(
        &mut self,
        element: &T,
    ) -> Result<(), CborSerializationError>
       where T: CborSerialize + ?Sized;
    fn end(self) -> Result<(), CborSerializationError>;
}
Expand description

Encoder of CBOR array

Required Methods§

Source

fn serialize_element<T>( &mut self, element: &T, ) -> Result<(), CborSerializationError>
where T: CborSerialize + ?Sized,

Serialize an element and add it to the array (appended to the current elements in the array). The number of elements added to the array must equal the size given to CborEncoder::encode_array When all elements have been serialized, Self::end must be called.

Source

fn end(self) -> Result<(), CborSerializationError>

End array serialization.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§