CborLen

Trait CborLen 

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§

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

Compute the CBOR encoding length in bytes of this value.

Implementations on Foreign Types§

§

impl<C> CborLen<C> for IpAddr

Available on crate feature std only.
§

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

§

impl<C> CborLen<C> for SocketAddr

Available on crate feature std only.
§

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

§

impl<C> CborLen<C> for bool

§

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

§

impl<C> CborLen<C> for char

§

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

§

impl<C> CborLen<C> for f32

§

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

§

impl<C> CborLen<C> for f64

§

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

§

impl<C> CborLen<C> for i8

§

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

§

impl<C> CborLen<C> for i16

§

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

§

impl<C> CborLen<C> for i32

§

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

§

impl<C> CborLen<C> for i64

§

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

§

impl<C> CborLen<C> for isize

Available on 64-bit only.
§

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

§

impl<C> CborLen<C> for str

§

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

§

impl<C> CborLen<C> for u8

§

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

§

impl<C> CborLen<C> for u16

§

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

§

impl<C> CborLen<C> for u32

§

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

§

impl<C> CborLen<C> for u64

§

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

§

impl<C> CborLen<C> for ()

§

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

§

impl<C> CborLen<C> for usize

Available on 64-bit only.
§

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

§

impl<C> CborLen<C> for CString

Available on crate feature alloc only.
§

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

§

impl<C> CborLen<C> for String

Available on crate feature alloc only.
§

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

§

impl<C> CborLen<C> for CStr

§

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

§

impl<C> CborLen<C> for Ipv4Addr

Available on crate feature std only.
§

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

§

impl<C> CborLen<C> for Ipv6Addr

Available on crate feature std only.
§

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

§

impl<C> CborLen<C> for SocketAddrV4

Available on crate feature std only.
§

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

§

impl<C> CborLen<C> for SocketAddrV6

Available on crate feature std only.
§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<C> CborLen<C> for AtomicBool

§

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

§

impl<C> CborLen<C> for AtomicI8

§

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

§

impl<C> CborLen<C> for AtomicI16

§

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

§

impl<C> CborLen<C> for AtomicI32

§

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

§

impl<C> CborLen<C> for AtomicI64

§

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

§

impl<C> CborLen<C> for AtomicIsize

§

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

§

impl<C> CborLen<C> for AtomicU8

§

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

§

impl<C> CborLen<C> for AtomicU16

§

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

§

impl<C> CborLen<C> for AtomicU32

§

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

§

impl<C> CborLen<C> for AtomicU64

§

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

§

impl<C> CborLen<C> for AtomicUsize

§

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

§

impl<C> CborLen<C> for Duration

§

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

§

impl<C> CborLen<C> for Path

Available on crate feature std only.
§

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

§

impl<C> CborLen<C> for PathBuf

Available on crate feature std only.
§

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

§

impl<C> CborLen<C> for SystemTime

Available on crate feature std only.
§

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

§

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

Available on crate feature alloc only.
§

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

§

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.
§

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

§

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

Available on crate feature alloc only.
§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

Available on crate feature alloc only.
§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

Available on crate feature std only.
§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

§

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>,

§

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

Implementors§

§

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

§

impl<C> CborLen<C> for IanaTag

§

impl<C> CborLen<C> for ByteSlice

§

impl<C> CborLen<C> for ByteVec

Available on crate feature alloc only.
§

impl<C> CborLen<C> for Int

§

impl<C> CborLen<C> for Tag

§

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

§

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