pub trait ByteLen<T>where
Self: SpecByteLen<T = T::V>,
T: DeepView + ?Sized,{
// Required method
exec fn length(&self, v: &T) -> len : usize;
// Provided method
open spec fn exec_inv(&self) -> bool { ... }
}Expand description
Computes the exact serialized length of a value already known to fit usize.
Unlike Prepare, this operation does not check the format’s consistency
predicate. Use Prepare::prepare for untrusted or newly constructed values.
Required Methods§
Provided Methods§
Implementations on Foreign Types§
Implementors§
impl ByteLen<BerLength> for BerLengthFmt
impl ByteLen<i8> for Integer8Fmt
impl ByteLen<i8> for I8
impl ByteLen<i16> for Integer16Fmt
impl ByteLen<i16> for I16Be
impl ByteLen<i16> for I16Le
impl ByteLen<i32> for I32Be
impl ByteLen<i32> for I32Le
impl ByteLen<i64> for I64Be
impl ByteLen<i64> for I64Le
impl ByteLen<u8> for U8
impl ByteLen<u16> for U16Be
impl ByteLen<u16> for U16Le
impl ByteLen<u32> for U24Be
impl ByteLen<u32> for U24Le
impl ByteLen<u32> for U32Be
impl ByteLen<u32> for U32Le
impl ByteLen<u64> for U64Be
impl ByteLen<u64> for U64Le
impl ByteLen<()> for BerEndFmt
impl ByteLen<()> for Empty
impl ByteLen<()> for Eof
impl ByteLen<BitStringOwned> for BitStringFmt<false>
Available on crate feature
alloc only.impl ByteLen<BmpString> for BmpStringFmt
Available on crate feature
alloc only.impl ByteLen<Ia5StringOwned> for Ia5StringFmt
Available on crate feature
alloc only.impl ByteLen<ObjectIdentifier> for ObjectIdentifierFmt
Available on crate feature
alloc only.impl ByteLen<PrintableStringOwned> for PrintableStringFmt
Available on crate feature
alloc only.impl ByteLen<Tag> for TagFmt
impl ByteLen<TeletexStringOwned> for TeletexStringFmt
Available on crate feature
alloc only.impl ByteLen<CborInitial> for CborInitialFmt
impl ByteLen<ExecNever> for Void
impl ByteLen<String> for UniversalStringFmt
Available on crate feature
alloc only.impl ByteLen<String> for Utf8StringFmt
Available on crate feature
alloc only.impl ByteLen<[u8]> for Tail
impl<'a, const DER: bool> ByteLen<Any<'a>> for AnyFmt<DER>
impl<'a, const DER: bool> ByteLen<Real<'a, DER>> for RealFmt<DER>
impl<'i> ByteLen<&'i str> for Utf8StringFmt
impl<'i> ByteLen<&'i [u8]> for Tail
impl<'i> ByteLen<Integer<'i>> for EnumeratedFmt
impl<'i> ByteLen<Integer<'i>> for IntegerFmt
impl<'i> ByteLen<Ia5String<'i>> for Ia5StringFmt
impl<'i> ByteLen<PrintableString<'i>> for PrintableStringFmt
impl<'i> ByteLen<TeletexString<'i>> for TeletexStringFmt
impl<'i, Len: AsLen> ByteLen<&'i [u8]> for Varied<Len>
impl<'i, const DER: bool> ByteLen<BitString<'i, DER>> for BitStringFmt<DER>
impl<'i, const DER: bool> ByteLen<GeneralizedTime<'i>> for GeneralizedTimeFmt<DER>
impl<'i, const DET: bool, const LIMIT: usize> ByteLen<CborValue<'i>> for CborFmt<DET, LIMIT>
impl<'i, const N: usize> ByteLen<&'i [u8]> for Fixed<N>
impl<A, AST> ByteLen<Option<AST>> for OptionalEnd<A>where
A: ByteLen<AST>,
AST: DeepView,
impl<A, AVal, B, BVal, const CHECK: bool> ByteLen<BVal> for Preceded<A, AVal, B, CHECK>
impl<A, B, AVal, BVal> ByteLen<(AVal, BVal)> for PairRev<A, B>
impl<A, B, BVal, T, const CHECK: bool> ByteLen<T> for Terminated<A, B, BVal, CHECK>
impl<A, B, C, D, E, TA, TB, TC, TD, TE> ByteLen<(TA, (TB, (TC, (TD, TE))))> for Permute5<A, B, C, D, E>
impl<A, B, C, D, TA, TB, TC, TD> ByteLen<(TA, (TB, (TC, TD)))> for Permute4<A, B, C, D>
impl<A, B, C, TA, TB, TC> ByteLen<(TA, (TB, TC))> for Permute3<A, B, C>
impl<A, B, STA, STB> ByteLen<(STA, STB)> for Bind<A, B>
impl<A, B, TA, TB> ByteLen<(&[TA], TB)> for Repeat<A, B>
impl<A, B, TA, TB> ByteLen<(Option<TA>, TB)> for Optional<A, B>
impl<A, B, TA, TB> ByteLen<Sum<TA, TB>> for Sum<A, B>
impl<A, B, TA, TB> ByteLen<Sum<TA, TB>> for Choice<A, B>
impl<A, B, TA, TB> ByteLen<(TA, TB)> for Pair<A, B>
impl<A, PredFn, T> ByteLen<T> for Refined<A, PredFn>
impl<A, T> ByteLen<&[T]> for RepeatTillEnd<A>
impl<A, T> ByteLen<Option<T>> for Opt<A>where
T: DeepView,
A: ByteLen<T>,
impl<A, T> ByteLen<Vec<T>> for RepeatTillEnd<A>
Available on crate feature
alloc only.impl<A, Then, ThenST> ByteLen<ThenST> for AndThen<A, Then>
impl<C, Elem> ByteLen<[Elem]> for SetOfFmt<C>
impl<C, Elem> ByteLen<Vec<Elem>> for SetOfFmt<C>
Available on crate feature
alloc only.impl<C, T> ByteLen<&[T]> for BerSequenceOfFmt<C>
impl<C, T> ByteLen<Vec<T>> for BerSequenceOfFmt<C>
Available on crate feature
alloc only.impl<C, T> ByteLen<T> for BerSequenceFmt<C>
impl<C, T, const LIMIT: usize> ByteLen<T> for BerCharStringFmt<C, LIMIT>
impl<Content, T, const DER: bool> ByteLen<T> for ASN1Fmt<Content, DER>
impl<F, T> ByteLen<T> for ImplicitlyTaggedFmt<F>
impl<Field, Default, Rest, R, const DER: bool> ByteLen<(Default, R)> for DefaultedFmt<Field, Default, Rest, DER>where
Field: SpecByteLen<T = Default> + ByteLen<Default>,
Rest: SpecByteLen<T = R::V> + ByteLen<R>,
Default: DeepView<V = Default> + PartialEq + Structural + Copy,
R: DeepView,
impl<Inner, M, MRev, T> ByteLen<T> for Mapped<Inner, BiMap<M, MRev>>
impl<Inner, N, T> ByteLen<[T]> for RepeatN<Inner, N>
impl<Inner, T> ByteLen<&T> for Ref<Inner>
impl<Inner, T> ByteLen<[T]> for Star<Inner>where
Inner: ByteLen<T>,
T: DeepView,
impl<Inner, T, const N: usize> ByteLen<[T; N]> for Array<N, Inner>where
Inner: ByteLen<T>,
T: DeepView,
impl<Inner, V, T> ByteLen<T> for Const<Inner, V>where
T: DeepView<V = V>,
Inner: SpecByteLen<T = V> + ByteLen<T>,
impl<Len, Inner, InnerST> ByteLen<InnerST> for ExactLen<Inner, Len>
impl<Len: AsLen> ByteLen<[u8]> for Varied<Len>
impl<Of, TagVal, Tg, T> ByteLen<T> for SuffixTagged<Of, Tg, TagVal>where
Tg: SpecByteLen<T = TagVal> + ByteLen<TagVal>,
TagVal: DeepView<V = TagVal> + PartialEq + Structural + Copy,
T: DeepView,
Of: ByteLen<T>,
impl<P1, P2, T1, T2> ByteLen<(T1, T2)> for Permute2<P1, P2>
impl<T, Inner> ByteLen<T> for Cond<Inner>where
T: DeepView,
Inner: ByteLen<T>,
impl<T, Inner> ByteLen<T> for Named<Inner>where
T: DeepView,
Inner: ByteLen<T>,
impl<T, Spec, Exec> ByteLen<T> for FnByteLen<T, Spec, Exec>where
T: DeepView + ?Sized,
Spec: SpecByteLen<T = T::V> + Consistency<Val = T::V>,
Exec: Fn(&T) -> usize,
impl<T, const LIMIT: usize> ByteLen<T> for BerBitStringFmt<LIMIT>
impl<Tg, TagVal, Of, T> ByteLen<T> for PrefixTagged<Tg, TagVal, Of>where
Tg: SpecByteLen<T = TagVal> + ByteLen<TagVal>,
TagVal: DeepView<V = TagVal> + PartialEq + Structural + Copy,
T: DeepView,
Of: ByteLen<T>,
impl<const DER: bool> ByteLen<bool> for BoolFmt<DER>
impl<const DER: bool> ByteLen<usize> for LengthFmt<DER>
impl<const DER: bool> ByteLen<AnyOwned> for AnyFmt<DER>
Available on crate feature
alloc only.impl<const DER: bool> ByteLen<UtcTime> for UtcTimeFmt<DER>
impl<const DET: bool> ByteLen<CborHead> for CborHeadFmt<DET>
impl<const LIMIT: usize> ByteLen<AnyOwned> for BerAnyFmt<LIMIT>
Available on crate feature
alloc only.impl<const LIMIT: usize> ByteLen<Vec<u8>> for BerOctetStringFmt<LIMIT>
Available on crate feature
alloc only.