minicbor::encode

Trait CborLen

Source
pub trait CborLen<C> {
    // Required method
    fn cbor_len(&self, ctx: &mut C) -> usize;
}
Expand description

A type that can calculate its own CBOR encoding length.

Required Methods§

Source

fn cbor_len(&self, ctx: &mut C) -> usize

Compute the CBOR encoding length in bytes of this value.

Implementations on Foreign Types§

Source§

impl<C> CborLen<C> for bool

Source§

fn cbor_len(&self, _: &mut C) -> usize

Source§

impl<C> CborLen<C> for char

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for f32

Source§

fn cbor_len(&self, _: &mut C) -> usize

Source§

impl<C> CborLen<C> for f64

Source§

fn cbor_len(&self, _: &mut C) -> usize

Source§

impl<C> CborLen<C> for i8

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for i16

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for i32

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for i64

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for isize

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for str

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for u8

Source§

fn cbor_len(&self, _: &mut C) -> usize

Source§

impl<C> CborLen<C> for u16

Source§

fn cbor_len(&self, _: &mut C) -> usize

Source§

impl<C> CborLen<C> for u32

Source§

fn cbor_len(&self, _: &mut C) -> usize

Source§

impl<C> CborLen<C> for u64

Source§

fn cbor_len(&self, _: &mut C) -> usize

Source§

impl<C> CborLen<C> for ()

Source§

fn cbor_len(&self, _: &mut C) -> usize

Source§

impl<C> CborLen<C> for usize

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for CStr

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for AtomicBool

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for AtomicI8

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for AtomicI16

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for AtomicI32

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for AtomicIsize

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for AtomicU8

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for AtomicU16

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for AtomicU32

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for AtomicUsize

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for Duration

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for NonZeroI8

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for NonZeroI16

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for NonZeroI32

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for NonZeroI64

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for NonZeroU8

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for NonZeroU16

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for NonZeroU32

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C> CborLen<C> for NonZeroU64

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T> CborLen<C> for PhantomData<T>

Source§

fn cbor_len(&self, _: &mut C) -> usize

Source§

impl<C, T: CborLen<C> + Copy> CborLen<C> for Cell<T>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C> + ?Sized> CborLen<C> for &T

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C> + ?Sized> CborLen<C> for &mut T

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>> CborLen<C> for Bound<T>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

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

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>> CborLen<C> for [T]

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>> CborLen<C> for RefCell<T>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>> CborLen<C> for Wrapping<T>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>> CborLen<C> for Range<T>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>> CborLen<C> for RangeFrom<T>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>> CborLen<C> for RangeInclusive<T>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>> CborLen<C> for RangeTo<T>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>> CborLen<C> for RangeToInclusive<T>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>, E: CborLen<C>> CborLen<C> for Result<T, E>

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<C, T: CborLen<C>, const N: usize> CborLen<C> for [T; N]

Source§

fn cbor_len(&self, ctx: &mut C) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>> CborLen<Ctx> for (A,)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>> CborLen<Ctx> for (A, B)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>> CborLen<Ctx> for (A, B, C)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>, H: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G, H)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>, H: CborLen<Ctx>, I: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>, H: CborLen<Ctx>, I: CborLen<Ctx>, J: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>, H: CborLen<Ctx>, I: CborLen<Ctx>, J: CborLen<Ctx>, K: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>, H: CborLen<Ctx>, I: CborLen<Ctx>, J: CborLen<Ctx>, K: CborLen<Ctx>, L: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>, H: CborLen<Ctx>, I: CborLen<Ctx>, J: CborLen<Ctx>, K: CborLen<Ctx>, L: CborLen<Ctx>, M: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L, M)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>, H: CborLen<Ctx>, I: CborLen<Ctx>, J: CborLen<Ctx>, K: CborLen<Ctx>, L: CborLen<Ctx>, M: CborLen<Ctx>, N: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>, H: CborLen<Ctx>, I: CborLen<Ctx>, J: CborLen<Ctx>, K: CborLen<Ctx>, L: CborLen<Ctx>, M: CborLen<Ctx>, N: CborLen<Ctx>, O: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Source§

impl<Ctx, A: CborLen<Ctx>, B: CborLen<Ctx>, C: CborLen<Ctx>, D: CborLen<Ctx>, E: CborLen<Ctx>, F: CborLen<Ctx>, G: CborLen<Ctx>, H: CborLen<Ctx>, I: CborLen<Ctx>, J: CborLen<Ctx>, K: CborLen<Ctx>, L: CborLen<Ctx>, M: CborLen<Ctx>, N: CborLen<Ctx>, O: CborLen<Ctx>, P: CborLen<Ctx>> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

fn cbor_len(&self, ctx: &mut Ctx) -> usize

Implementors§

Source§

impl<C> CborLen<C> for IanaTag

Source§

impl<C> CborLen<C> for ByteSlice

Source§

impl<C> CborLen<C> for Int

Source§

impl<C> CborLen<C> for Tag

Source§

impl<C, const N: u64, T: CborLen<C>> CborLen<C> for Tagged<N, T>

Source§

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