pub trait Serialize {
// Required method
fn serialize<'a, W>(
&self,
serializer: &'a mut Serializer<W>,
force_canonical: bool
) -> Result<&'a mut Serializer<W>, Error>
where W: Write;
// Provided methods
fn to_cbor_bytes(&self) -> Vec<u8> ⓘ { ... }
fn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ { ... }
}
Required Methods§
fn serialize<'a, W>(
&self,
serializer: &'a mut Serializer<W>,
force_canonical: bool
) -> Result<&'a mut Serializer<W>, Error>where
W: Write,
Provided Methods§
sourcefn to_cbor_bytes(&self) -> Vec<u8> ⓘ
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.
sourcefn to_canonical_cbor_bytes(&self) -> Vec<u8> ⓘ
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.