Skip to main content

CborLen

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 IpAddr

Available on crate feature std only.
Source§

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

Source§

impl<C> CborLen<C> for SocketAddr

Available on crate feature std only.
Source§

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

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

Available on 32-bit only.
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

Available on 32-bit only.
Source§

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

Source§

impl<C> CborLen<C> for CString

Available on crate feature alloc only.
Source§

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

Source§

impl<C> CborLen<C> for String

Available on crate feature alloc only.
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 Ipv4Addr

Available on crate feature std only.
Source§

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

Source§

impl<C> CborLen<C> for Ipv6Addr

Available on crate feature std only.
Source§

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

Source§

impl<C> CborLen<C> for SocketAddrV4

Available on crate feature std only.
Source§

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

Source§

impl<C> CborLen<C> for SocketAddrV6

Available on crate feature std only.
Source§

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

Source§

impl<C> CborLen<C> for NonZero<i8>

Source§

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

Source§

impl<C> CborLen<C> for NonZero<i16>

Source§

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

Source§

impl<C> CborLen<C> for NonZero<i32>

Source§

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

Source§

impl<C> CborLen<C> for NonZero<i64>

Source§

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

Source§

impl<C> CborLen<C> for NonZero<isize>

Source§

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

Source§

impl<C> CborLen<C> for NonZero<u8>

Source§

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

Source§

impl<C> CborLen<C> for NonZero<u16>

Source§

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

Source§

impl<C> CborLen<C> for NonZero<u32>

Source§

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

Source§

impl<C> CborLen<C> for NonZero<u64>

Source§

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

Source§

impl<C> CborLen<C> for NonZero<usize>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<bool>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<i8>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<i16>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<i32>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<i64>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<isize>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<u8>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<u16>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<u32>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<u64>

Source§

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

Source§

impl<C> CborLen<C> for Atomic<usize>

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 Path

Available on crate feature std only.
Source§

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

Source§

impl<C> CborLen<C> for PathBuf

Available on crate feature std only.
Source§

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

Source§

impl<C> CborLen<C> for SystemTime

Available on crate feature std only.
Source§

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

Source§

impl<C, K, V> CborLen<C> for BTreeMap<K, V>
where K: CborLen<C>, V: CborLen<C>,

Available on crate feature alloc only.
Source§

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

Source§

impl<C, K, V, S> CborLen<C> for HashMap<K, V, S>
where K: CborLen<C>, V: CborLen<C>, S: BuildHasher,

Available on crate feature std only.
Source§

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

Source§

impl<C, T> CborLen<C> for Cow<'_, T>
where T: CborLen<C> + ToOwned + ?Sized,

Available on crate feature alloc only.
Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Available on crate feature alloc only.
Source§

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

Source§

impl<C, T> CborLen<C> for BinaryHeap<T>
where T: CborLen<C>,

Source§

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

Source§

impl<C, T> CborLen<C> for BTreeSet<T>
where T: CborLen<C>,

Source§

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

Source§

impl<C, T> CborLen<C> for LinkedList<T>
where T: CborLen<C>,

Source§

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

Source§

impl<C, T> CborLen<C> for VecDeque<T>
where T: CborLen<C>,

Source§

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

Source§

impl<C, T> CborLen<C> for Vec<T>
where T: CborLen<C>,

Source§

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

Source§

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

Source§

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

Source§

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

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> for Wrapping<T>
where T: CborLen<C>,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<C, T, S> CborLen<C> for HashSet<T, S>
where T: CborLen<C>, S: BuildHasher,

Available on crate feature std only.
Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<Ctx, A, B, C, D, E, F, G, H, I> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I)
where 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>,

Source§

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

Source§

impl<Ctx, A, B, C, D, E, F, G, H, I, J> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J)
where 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>,

Source§

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

Source§

impl<Ctx, A, B, C, D, E, F, G, H, I, J, K> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K)
where 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>,

Source§

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

Source§

impl<Ctx, A, B, C, D, E, F, G, H, I, J, K, L> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L)
where 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>,

Source§

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

Source§

impl<Ctx, A, B, C, D, E, F, G, H, I, J, K, L, M> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L, M)
where 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>,

Source§

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

Source§

impl<Ctx, A, B, C, D, E, F, G, H, I, J, K, L, M, N> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)
where 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>,

Source§

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

Source§

impl<Ctx, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)
where 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>,

Source§

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

Source§

impl<Ctx, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> CborLen<Ctx> for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)
where 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>,

Source§

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

Implementors§

Source§

impl<'b, C> CborLen<C> for Token<'b>

Source§

impl<C> CborLen<C> for IanaTag

Source§

impl<C> CborLen<C> for ByteSlice

Source§

impl<C> CborLen<C> for ByteVec

Available on crate feature alloc only.
Source§

impl<C> CborLen<C> for Int

Source§

impl<C> CborLen<C> for Tag

Source§

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

Source§

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