Trait dcbor::CBORTaggedDecodable
source · pub trait CBORTaggedDecodable: TryFrom<CBOR> + CBORTagged {
// Required method
fn from_untagged_cbor(cbor: CBOR) -> Result<Self>
where Self: Sized;
// Provided methods
fn from_tagged_cbor(cbor: CBOR) -> Result<Self>
where Self: Sized { ... }
fn from_tagged_cbor_data(data: impl AsRef<[u8]>) -> Result<Self>
where Self: Sized { ... }
fn from_untagged_cbor_data(data: impl AsRef<[u8]>) -> Result<Self>
where Self: Sized { ... }
}Expand description
A type that can be decoded from CBOR with a specific tag.
Typically types that implement this trait will only provide the CBOR_TAG
associated constant and implement the from_untagged_cbor function.
Required Methods§
sourcefn from_untagged_cbor(cbor: CBOR) -> Result<Self>where
Self: Sized,
fn from_untagged_cbor(cbor: CBOR) -> Result<Self>where
Self: Sized,
Creates an instance of this type by decoding it from untagged CBOR.
Provided Methods§
sourcefn from_tagged_cbor(cbor: CBOR) -> Result<Self>where
Self: Sized,
fn from_tagged_cbor(cbor: CBOR) -> Result<Self>where
Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
Object Safety§
This trait is not object safe.