pub trait Serialize {
    // Required method
    fn serialize<'a, W: Write + Sized>(
        &self,
        serializer: &'a mut Serializer<W>,
        force_canonical: bool
    ) -> Result<&'a mut Serializer<W>>;

    // Provided methods
    fn to_cbor_bytes(&self) -> Vec<u8> { ... }
    fn to_canonical_cbor_bytes(&self) -> Vec<u8> { ... }
}

Required Methods§

source

fn serialize<'a, W: Write + Sized>( &self, serializer: &'a mut Serializer<W>, force_canonical: bool ) -> Result<&'a mut Serializer<W>>

Provided Methods§

source

fn to_cbor_bytes(&self) -> Vec<u8>

Bytes of a structure using the CBOR bytes as per the CDDL spec which for foo = bytes will include the CBOR bytes type/len, etc. This gives the original bytes in the case where this was created from bytes originally, or will use whatever the specific encoding details are present in any encoding details struct for the type.

source

fn to_canonical_cbor_bytes(&self) -> Vec<u8>

Bytes of a structure using the CBOR bytes as per the CDDL spec which for foo = bytes will include the CBOR bytes type/len, etc. This gives the canonically encoded CBOR bytes always

Object Safety§

This trait is not object safe.

Implementors§