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§
Sourcefn from_slice(slice: &[u8]) -> Result<Self>
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.
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.