minicbor::bytes

Trait EncodeBytes

Source
pub trait EncodeBytes<C> {
    // Required method
    fn encode_bytes<W: Write>(
        &self,
        e: &mut Encoder<W>,
        ctx: &mut C,
    ) -> Result<(), Error<W::Error>>;

    // Provided method
    fn is_nil(&self) -> bool { ... }
}
Expand description

Like Encode but specific for encoding of byte slices.

Required Methods§

Source

fn encode_bytes<W: Write>( &self, e: &mut Encoder<W>, ctx: &mut C, ) -> Result<(), Error<W::Error>>

Provided Methods§

Source

fn is_nil(&self) -> bool

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> + ?Sized> EncodeBytes<C> for &'a T

Source§

fn encode_bytes<W: Write>( &self, e: &mut Encoder<W>, ctx: &mut C, ) -> Result<(), Error<W::Error>>

Source§

impl<C> EncodeBytes<C> for [u8]

Source§

fn encode_bytes<W: Write>( &self, e: &mut Encoder<W>, _: &mut C, ) -> Result<(), Error<W::Error>>

Source§

impl<C, T: EncodeBytes<C>> EncodeBytes<C> for Option<T>

Source§

fn encode_bytes<W: Write>( &self, e: &mut Encoder<W>, ctx: &mut C, ) -> Result<(), Error<W::Error>>

Source§

fn is_nil(&self) -> bool

Source§

impl<C, const N: usize> EncodeBytes<C> for [u8; N]

Source§

fn encode_bytes<W: Write>( &self, e: &mut Encoder<W>, _: &mut C, ) -> Result<(), Error<W::Error>>

Implementors§

Source§

impl<C> EncodeBytes<C> for ByteSlice

Source§

impl<C, const N: usize> EncodeBytes<C> for ByteArray<N>