Trait oasis_cbor::decode::Decode
source · pub trait Decode {
fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
where
Self: Sized;
fn try_default() -> Result<Self, DecodeError>
where
Self: Sized,
{ ... }
fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where
Self: Sized,
{ ... }
}
Expand description
Trait for types that can be decoded from CBOR.
Required Methods
sourcefn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
Try to decode from a given CBOR value.
Provided Methods
sourcefn try_default() -> Result<Self, DecodeError>where
Self: Sized,
fn try_default() -> Result<Self, DecodeError>where
Self: Sized,
Try to decode from a missing/null/undefined value.
sourcefn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
Try to decode from a given CBOR value, calling try_default
in case the value is null or
undefined.