pub trait EncodeBytes<C> {
// Required method
fn encode_bytes<W>(
&self,
e: &mut Encoder<W>,
ctx: &mut C,
) -> Result<(), Error<<W as Write>::Error>>
where W: Write;
// Provided method
fn is_nil(&self) -> bool { ... }
}Expand description
Like Encode but specific for encoding of byte slices.
Required Methods§
fn encode_bytes<W>(
&self,
e: &mut Encoder<W>,
ctx: &mut C,
) -> Result<(), Error<<W as Write>::Error>>where
W: Write,
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, C, T> EncodeBytes<C> for &'a Twhere
T: EncodeBytes<C> + ?Sized,
Available on crate feature derive only.
impl<'a, C, T> EncodeBytes<C> for &'a Twhere
T: EncodeBytes<C> + ?Sized,
Available on crate feature
derive only.Source§impl<C> EncodeBytes<C> for Cow<'_, [u8]>
Available on crate features alloc and derive only.
impl<C> EncodeBytes<C> for Cow<'_, [u8]>
Available on crate features
alloc and derive only.Source§impl<C> EncodeBytes<C> for Vec<u8>
Available on crate features alloc and derive only.
impl<C> EncodeBytes<C> for Vec<u8>
Available on crate features
alloc and derive only.Source§impl<C> EncodeBytes<C> for [u8]
Available on crate feature derive only.
impl<C> EncodeBytes<C> for [u8]
Available on crate feature
derive only.Source§impl<C, T> EncodeBytes<C> for Option<T>where
T: EncodeBytes<C>,
Available on crate feature derive only.
impl<C, T> EncodeBytes<C> for Option<T>where
T: EncodeBytes<C>,
Available on crate feature
derive only.Implementors§
impl<C> EncodeBytes<C> for ByteSlice
Available on crate feature
derive only.impl<C> EncodeBytes<C> for ByteVec
Available on crate features
alloc and derive only.impl<C, const N: usize> EncodeBytes<C> for ByteArray<N>
Available on crate feature
derive only.