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

source§

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

source§

impl<C> CborLen<C> for SocketAddr

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

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 CString

source§

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

source§

impl<C> CborLen<C> for String

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

source§

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

source§

impl<C> CborLen<C> for Ipv6Addr

source§

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

source§

impl<C> CborLen<C> for SocketAddrV4

source§

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

source§

impl<C> CborLen<C> for SocketAddrV6

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 AtomicI64

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 AtomicU64

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 Path

source§

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

source§

impl<C> CborLen<C> for PathBuf

source§

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

source§

impl<C> CborLen<C> for SystemTime

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, K, V> CborLen<C> for BTreeMap<K, V>
where K: CborLen<C>, V: CborLen<C>,

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,

source§

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

source§

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

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, S> CborLen<C> for HashSet<T, S>
where T: CborLen<C>, S: BuildHasher,

source§

fn cbor_len(&self, ctx: &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> + ?Sized> CborLen<C> for Box<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 BinaryHeap<T>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<C, T: CborLen<C>> CborLen<C> for Vec<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<'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

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>