pub trait Decode<'b>: Sized {
type Error: Error + 'static;
// Required method
fn decode(d: &mut Decoder<'b>) -> Result<Self, Self::Error>;
}Expand description
A type that can be decoded from CBOR.
Required Associated Types§
Required Methods§
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.
Implementations on Foreign Types§
Source§impl Decode<'_> for AtomicBool
impl Decode<'_> for AtomicBool
Source§impl<'a> Decode<'a> for Box<str>
Available on crate feature alloc only.Decodes a byte string, supporting both definite-length and indefinite-length encodings.
impl<'a> Decode<'a> for Box<str>
alloc only.Decodes a byte string, supporting both definite-length and indefinite-length encodings.
Source§impl<'a> Decode<'a> for Box<[u8]>
Available on crate feature alloc only.Decodes a byte string, supporting both definite-length and indefinite-length encodings.
impl<'a> Decode<'a> for Box<[u8]>
alloc only.Decodes a byte string, supporting both definite-length and indefinite-length encodings.
Source§impl<'a> Decode<'a> for String
Available on crate feature alloc only.Decodes a byte string, supporting both definite-length and indefinite-length encodings.
impl<'a> Decode<'a> for String
alloc only.Decodes a byte string, supporting both definite-length and indefinite-length encodings.
Source§impl<'a> Decode<'a> for Vec<u8>
Available on crate feature alloc only.Decodes a byte string, supporting both definite-length and indefinite-length encodings.
impl<'a> Decode<'a> for Vec<u8>
alloc only.Decodes a byte string, supporting both definite-length and indefinite-length encodings.
Source§impl<'a, 'b> Decode<'b> for &'a strwhere
'b: 'a,
Decodes a definite-length string.
impl<'a, 'b> Decode<'b> for &'a strwhere
'b: 'a,
Decodes a definite-length string.
If you need to also support indefinite-length byte strings, consider using an allocated type
such as String or Box<str>.
Source§impl<'a, 'b> Decode<'b> for &'a [u8]where
'b: 'a,
Decodes a definite-length byte string.
impl<'a, 'b> Decode<'b> for &'a [u8]where
'b: 'a,
Decodes a definite-length byte string.
If you need to also support indefinite-length byte strings, consider using an allocated type
such as Vec<u8> or Box<[u8]>.
Source§impl<'b> Decode<'b> for &'b Path
Available on crate feature std only.Decodes a definite-length string as a &Path.
impl<'b> Decode<'b> for &'b Path
std only.Decodes a definite-length string as a &Path.
If you need to also support indefinite-length byte strings, consider using an allocated type
such as PathBuf or Box<Path>.
Source§impl<'b> Decode<'b> for AtomicIsize
impl<'b> Decode<'b> for AtomicIsize
Source§impl<'b> Decode<'b> for AtomicUsize
impl<'b> Decode<'b> for AtomicUsize
Source§impl<'b, K, V> Decode<'b> for BinaryHeap<(K, V)>
Available on crate feature alloc only.
impl<'b, K, V> Decode<'b> for BinaryHeap<(K, V)>
alloc only.Source§impl<'b, T> Decode<'b> for BinaryHeap<T>
Available on crate feature alloc only.
impl<'b, T> Decode<'b> for BinaryHeap<T>
alloc only.Source§impl<'b, T: Decode<'b>> Decode<'b> for LinkedList<T>
impl<'b, T: Decode<'b>> Decode<'b> for LinkedList<T>
Source§impl<const N: usize> Decode<'_> for [u8; N]
Decodes a byte string, supporting only definite-length encodings.
impl<const N: usize> Decode<'_> for [u8; N]
Decodes a byte string, supporting only definite-length encodings.