pub trait CborSerializable: AsCborValue {
    // Provided methods
    fn from_slice(slice: &[u8]) -> Result<Self> { ... }
    fn to_vec(self) -> Result<Vec<u8>> { ... }
}
Expand description

Extension trait that adds serialization/deserialization methods.

Provided Methods§

source

fn from_slice(slice: &[u8]) -> Result<Self>

Create an object instance from serialized CBOR data in a slice. This method will fail (with CoseError::ExtraneousData) if there is additional CBOR data after the object.

source

fn to_vec(self) -> Result<Vec<u8>>

Serialize this object to a vector, consuming it along the way.

Implementations on Foreign Types§

source§

impl CborSerializable for Value

Implementors§