Trait minicbor::bytes::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

Object Safety§

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 Cow<'_, [u8]>

source§

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

source§

impl<C> EncodeBytes<C> for Vec<u8>

source§

fn encode_bytes<W: Write>( &self, e: &mut Encoder<W>, _: &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> EncodeBytes<C> for ByteVec

source§

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