pub trait DecodeBytes<'b, C>: Sized {
// Required method
fn decode_bytes(d: &mut Decoder<'b>, ctx: &mut C) -> Result<Self, Error>;
// Provided method
fn nil() -> Option<Self> { ... }
}Expand description
Like Decode but specific for decoding from byte slices.
Required Methods§
Provided 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<'a, 'b, C> DecodeBytes<'b, C> for &'a [u8]where
'b: 'a,
Available on crate feature derive only.
impl<'a, 'b, C> DecodeBytes<'b, C> for &'a [u8]where
'b: 'a,
Available on crate feature
derive only.Source§impl<'b, C> DecodeBytes<'b, C> for Cow<'_, [u8]>
Available on crate features alloc and derive only.
impl<'b, C> DecodeBytes<'b, C> for Cow<'_, [u8]>
Available on crate features
alloc and derive only.Source§impl<'b, C> DecodeBytes<'b, C> for Vec<u8>
Available on crate features alloc and derive only.
impl<'b, C> DecodeBytes<'b, C> for Vec<u8>
Available on crate features
alloc and derive only.Source§impl<'b, C, T> DecodeBytes<'b, C> for Option<T>where
T: DecodeBytes<'b, C>,
Available on crate feature derive only.
impl<'b, C, T> DecodeBytes<'b, C> for Option<T>where
T: DecodeBytes<'b, C>,
Available on crate feature
derive only.Source§impl<'b, C, const N: usize> DecodeBytes<'b, C> for [u8; N]
Available on crate feature derive only.
impl<'b, C, const N: usize> DecodeBytes<'b, C> for [u8; N]
Available on crate feature
derive only.Implementors§
impl<'a, 'b, C> DecodeBytes<'b, C> for &'a ByteSlicewhere
'b: 'a,
Available on crate feature
derive only.impl<'b, C> DecodeBytes<'b, C> for ByteVec
Available on crate features
alloc and derive only.impl<'b, C, const N: usize> DecodeBytes<'b, C> for ByteArray<N>
Available on crate feature
derive only.