Skip to main content

SpecByteLen

Trait SpecByteLen 

Source
pub trait SpecByteLen {
    type T;

    // Required method
    spec fn byte_len(&self, v: Self::T) -> nat;
}
Expand description

Denotes the byte length of a value w.r.t. a combinator’s format spec.

Required Associated Types§

Source

type T

The type of values whose byte length is being computed.

Required Methods§

Source

spec fn byte_len(&self, v: Self::T) -> nat

Returns the number of bytes v occupies when serialized.

Implementations on Foreign Types§

Source§

impl<S: SpecByteLen> SpecByteLen for &S

Source§

open spec fn byte_len(&self, v: Self::T) -> nat

{ (*self).byte_len(v) }
Source§

type T = <S as SpecByteLen>::T

Implementors§

Source§

impl SpecByteLen for BerEndFmt

Source§

type T = ()

Source§

impl SpecByteLen for Integer8Fmt

Source§

type T = i8

Source§

impl SpecByteLen for Integer16Fmt

Source§

type T = i16

Source§

impl SpecByteLen for BerLengthFmt

Source§

impl SpecByteLen for BmpStringFmt

Source§

impl SpecByteLen for EnumeratedFmt

Source§

type T = int

Source§

impl SpecByteLen for Ia5StringFmt

Source§

impl SpecByteLen for IntegerFmt

Source§

type T = int

Source§

impl SpecByteLen for ObjectIdentifierFmt

Source§

impl SpecByteLen for PrintableStringFmt

Source§

impl SpecByteLen for TagFmt

Source§

type T = Tag

Source§

impl SpecByteLen for TeletexStringFmt

Source§

impl SpecByteLen for UniversalStringFmt

Source§

type T = Seq<char>

Source§

impl SpecByteLen for Utf8StringFmt

Source§

type T = Seq<char>

Source§

impl SpecByteLen for CborInitialFmt

Source§

impl SpecByteLen for Empty

Source§

type T = ()

Source§

impl SpecByteLen for Void

Source§

impl SpecByteLen for I8

Source§

type T = i8

Source§

impl SpecByteLen for I16Be

Source§

type T = i16

Source§

impl SpecByteLen for I16Le

Source§

type T = i16

Source§

impl SpecByteLen for I32Be

Source§

type T = i32

Source§

impl SpecByteLen for I32Le

Source§

type T = i32

Source§

impl SpecByteLen for I64Be

Source§

type T = i64

Source§

impl SpecByteLen for I64Le

Source§

type T = i64

Source§

impl SpecByteLen for Eof

Source§

type T = ()

Source§

impl SpecByteLen for Tail

Source§

type T = Seq<u8>

Source§

impl SpecByteLen for U8

Source§

type T = u8

Source§

impl SpecByteLen for U16Be

Source§

type T = u16

Source§

impl SpecByteLen for U16Le

Source§

type T = u16

Source§

impl SpecByteLen for U24Be

Source§

type T = u32

Source§

impl SpecByteLen for U24Le

Source§

type T = u32

Source§

impl SpecByteLen for U32Be

Source§

type T = u32

Source§

impl SpecByteLen for U32Le

Source§

type T = u32

Source§

impl SpecByteLen for U64Be

Source§

type T = u64

Source§

impl SpecByteLen for U64Le

Source§

type T = u64

Source§

impl<A, B> SpecByteLen for Sum<A, B>
where A: SpecByteLen, B: SpecByteLen,

Source§

type T = Sum<<A as SpecByteLen>::T, <B as SpecByteLen>::T>

Source§

impl<A, B> SpecByteLen for Choice<A, B>
where A: SpecByteLen, B: SpecByteLen,

Source§

type T = Sum<<A as SpecByteLen>::T, <B as SpecByteLen>::T>

Source§

impl<A, B> SpecByteLen for PairRev<A, B>
where A: SpecByteLen, B: SpecByteLen,

Source§

type T = (<A as SpecByteLen>::T, <B as SpecByteLen>::T)

Source§

impl<A, B> SpecByteLen for Bind<A, B>
where A: SpecByteLen, B: SpecMap<Input = A::T>, B::Output: SpecByteLen,

Source§

type T = (<A as SpecByteLen>::T, <<B as SpecMap>::Output as SpecByteLen>::T)

Source§

impl<A, B, const CHECK: bool> SpecByteLen for Preceded<A, A::T, B, CHECK>
where A: SpecByteLen, B: SpecByteLen,

Source§

type T = <B as SpecByteLen>::T

Source§

impl<A, B, const CHECK: bool> SpecByteLen for Terminated<A, B, B::T, CHECK>
where A: SpecByteLen, B: SpecByteLen,

Source§

type T = <A as SpecByteLen>::T

Source§

impl<A, Pred> SpecByteLen for Refined<A, Pred>
where A: SpecByteLen, Pred: SpecPred<A::T>,

Source§

type T = <A as SpecByteLen>::T

Source§

impl<A, Then: SpecByteLen> SpecByteLen for AndThen<A, Then>

Source§

type T = <Then as SpecByteLen>::T

Source§

impl<A: SpecByteLen> SpecByteLen for Star<A>

Source§

type T = Seq<<A as SpecByteLen>::T>

Source§

impl<A: SpecByteLen, B: SpecByteLen> SpecByteLen for Optional<A, B>

Source§

type T = (Option<<A as SpecByteLen>::T>, <B as SpecByteLen>::T)

Source§

impl<A: SpecByteLen, B: SpecByteLen> SpecByteLen for Repeat<A, B>

Source§

type T = (Seq<<A as SpecByteLen>::T>, <B as SpecByteLen>::T)

Source§

impl<A: SpecByteLen, B: SpecByteLen> SpecByteLen for Pair<A, B>

Source§

type T = (<A as SpecByteLen>::T, <B as SpecByteLen>::T)

Source§

impl<A: SpecByteLen, B: SpecByteLen, C: SpecByteLen> SpecByteLen for Permute3<A, B, C>

Source§

type T = (<A as SpecByteLen>::T, (<B as SpecByteLen>::T, <C as SpecByteLen>::T))

Source§

impl<A: SpecByteLen, B: SpecByteLen, C: SpecByteLen, D: SpecByteLen> SpecByteLen for Permute4<A, B, C, D>

Source§

type T = (<A as SpecByteLen>::T, (<B as SpecByteLen>::T, (<C as SpecByteLen>::T, <D as SpecByteLen>::T)))

Source§

impl<A: SpecByteLen, B: SpecByteLen, C: SpecByteLen, D: SpecByteLen, E: SpecByteLen> SpecByteLen for Permute5<A, B, C, D, E>

Source§

type T = (<A as SpecByteLen>::T, (<B as SpecByteLen>::T, (<C as SpecByteLen>::T, (<D as SpecByteLen>::T, <E as SpecByteLen>::T))))

Source§

impl<C: SpecByteLen> SpecByteLen for SetOfFmt<C>

Source§

type T = Seq<<C as SpecByteLen>::T>

Source§

impl<C: SpecByteLen> SpecByteLen for OptionalEnd<C>

Source§

type T = Option<<C as SpecByteLen>::T>

Source§

impl<C: SpecByteLen> SpecByteLen for RepeatTillEnd<C>

Source§

type T = Seq<<C as SpecByteLen>::T>

Source§

impl<C: SpecByteLen, N: AsLen> SpecByteLen for RepeatN<C, N>

Source§

type T = Seq<<C as SpecByteLen>::T>

Source§

impl<C: SpecCombinator> SpecByteLen for BerSequenceFmt<C>

Source§

type T = <C as SpecByteLen>::T

Source§

impl<C: SpecCombinator> SpecByteLen for BerSequenceOfFmt<C>

Source§

type T = Seq<<C as SpecByteLen>::T>

Source§

impl<C: SpecCombinator, const LIMIT: usize> SpecByteLen for BerCharStringFmt<C, LIMIT>

Source§

type T = <C as SpecByteLen>::T

Source§

impl<Content: SpecCombinator, const DER: bool> SpecByteLen for ASN1Fmt<Content, DER>

Source§

type T = <Content as SpecParser>::PVal

Source§

impl<F> SpecByteLen for ImplicitlyTaggedFmt<F>

Source§

type T = <F as SpecByteLen>::T

Source§

impl<Field, Rest, const DER: bool> SpecByteLen for DefaultedFmt<Field, Field::T, Rest, DER>
where Field: SpecByteLen, Rest: SpecByteLen,

Source§

type T = (<Field as SpecByteLen>::T, <Rest as SpecByteLen>::T)

Source§

impl<Head, Tail> SpecByteLen for Implicit<Head, Tail>
where Head: SpecByteLen, Tail: DepCombinator<Key = Head::T>, Tail::Body: SpecByteLen<T = Tail::Val>,

Source§

type T = <Tail as DepCombinator>::Val

Source§

impl<Inner> SpecByteLen for Const<Inner, Inner::T>
where Inner: SpecByteLen,

Source§

type T = <Inner as SpecByteLen>::T

Source§

impl<Inner, M> SpecByteLen for Mapped<Inner, M>
where Inner: SpecByteLen, M: SpecMapper<In = Inner::T>,

Source§

type T = <M as SpecMapper>::Out

Source§

impl<Inner, M> SpecByteLen for TryMap<Inner, M>
where Inner: SpecByteLen, M: SpecMapper<In = Inner::T>,

Source§

type T = <M as SpecMapper>::Out

Source§

impl<Inner, M, MRev> SpecByteLen for Mapped<Inner, BiMap<M, MRev>>
where Inner: SpecByteLen, M: SpecMap<Input = Inner::T>, MRev: SpecMap<Input = M::Output, Output = M::Input>,

Source§

type T = <M as SpecMap>::Output

Source§

impl<Inner: SpecByteLen> SpecByteLen for Cond<Inner>

Source§

type T = <Inner as SpecByteLen>::T

Source§

impl<Inner: SpecByteLen> SpecByteLen for Named<Inner>

Source§

type T = <Inner as SpecByteLen>::T

Source§

impl<Inner: SpecByteLen> SpecByteLen for Opt<Inner>

Source§

type T = Option<<Inner as SpecByteLen>::T>

Source§

impl<Inner: SpecByteLen> SpecByteLen for Ref<Inner>

Source§

type T = <Inner as SpecByteLen>::T

Source§

impl<Inner: SpecByteLen, Len: AsLen> SpecByteLen for ExactLen<Inner, Len>

Source§

type T = <Inner as SpecByteLen>::T

Source§

impl<Len: AsLen> SpecByteLen for Varied<Len>

Source§

type T = Seq<u8>

Source§

impl<Of, Tg> SpecByteLen for SuffixTagged<Of, Tg, Tg::T>
where Tg: SpecByteLen, Of: SpecByteLen,

Source§

type T = <Of as SpecByteLen>::T

Source§

impl<Output, T, Spec, Exec> SpecByteLen for FnSerializer<Output, T, Spec, Exec>
where Output: OutputBuf, T: DeepView + ?Sized, Spec: SpecByteLen<T = T::V> + SpecSerializer<SVal = T::V> + Consistency<Val = T::V>, Exec: Fn(&T, &mut Output),

Source§

type T = <T as DeepView>::V

Source§

impl<P1: SpecByteLen, P2: SpecByteLen> SpecByteLen for Permute2<P1, P2>

Source§

type T = (<P1 as SpecByteLen>::T, <P2 as SpecByteLen>::T)

Source§

impl<Repr, Tuple, Nominal> SpecByteLen for Bits<Repr, Tuple, Nominal>
where Repr: SpecByteLen,

Source§

type T = Nominal

Source§

impl<SpecP, Cnstcy, Blen> SpecByteLen for ParserSpecs<SpecP, Cnstcy, Blen>
where Blen: SpecByteLen, SpecP: SpecParser<PVal = Blen::T>, Cnstcy: Consistency<Val = Blen::T>,

Source§

type T = <Blen as SpecByteLen>::T

Source§

impl<SpecS, Blen> SpecByteLen for SerializerSpecs<SpecS, Blen>
where Blen: SpecByteLen, SpecS: SpecSerializer<SVal = Blen::T>,

Source§

type T = <Blen as SpecByteLen>::T

Source§

impl<T> SpecByteLen for BundledSpecs<T>

Source§

type T = T

Source§

impl<T> SpecByteLen for ByteLenFnSpec<T>

Source§

type T = T

Source§

impl<T, C: SpecByteLen, const N: usize> SpecByteLen for Dispatch<T, C, N>

Source§

type T = <C as SpecByteLen>::T

Source§

impl<T, Spec, Exec> SpecByteLen for FnByteLen<T, Spec, Exec>
where T: DeepView + ?Sized, Spec: SpecByteLen<T = T::V> + Consistency<Val = T::V>, Exec: Fn(&T) -> usize,

Source§

type T = <T as DeepView>::V

Source§

impl<T, Spec, Exec> SpecByteLen for FnPrepare<T, Spec, Exec>
where T: DeepView + ?Sized, Spec: SpecByteLen<T = T::V> + Consistency<Val = T::V>, Exec: Fn(&T) -> Result<usize, PreSerializeError>,

Source§

type T = <T as DeepView>::V

Source§

impl<Tg, Of> SpecByteLen for PrefixTagged<Tg, Tg::T, Of>
where Tg: SpecByteLen, Of: SpecByteLen,

Source§

type T = <Of as SpecByteLen>::T

Source§

impl<const DER: bool> SpecByteLen for AnyFmt<DER>

Source§

impl<const DER: bool> SpecByteLen for BitStringFmt<DER>

Source§

impl<const DER: bool> SpecByteLen for BoolFmt<DER>

Source§

impl<const DER: bool> SpecByteLen for GeneralizedTimeFmt<DER>

Source§

impl<const DER: bool> SpecByteLen for LengthFmt<DER>

Source§

impl<const DER: bool> SpecByteLen for NatLengthFmt<DER>

Source§

type T = nat

Source§

impl<const DER: bool> SpecByteLen for RealFmt<DER>

Source§

type T = Seq<u8>

Source§

impl<const DER: bool> SpecByteLen for UtcTimeFmt<DER>

Source§

impl<const DET: bool> SpecByteLen for CborHeadFmt<DET>

Source§

impl<const DET: bool, const LIMIT: usize> SpecByteLen for CborFmt<DET, LIMIT>

Source§

impl<const LIMIT: usize> SpecByteLen for BerAnyFmt<LIMIT>

Source§

impl<const LIMIT: usize> SpecByteLen for BerBitStringFmt<LIMIT>

Source§

impl<const LIMIT: usize> SpecByteLen for BerOctetStringFmt<LIMIT>

Source§

type T = Seq<u8>

Source§

impl<const LIMIT: usize, Body, Param> SpecByteLen for FixWith<LIMIT, Body, Param>
where Body: SpecRecBody, Param: DeepView<V = Body::Param>,

Source§

type T = <Body as SpecRecBody>::T

Source§

impl<const MINIMAL: bool> SpecByteLen for Base128Fmt<MINIMAL>

Source§

type T = u64

Source§

impl<const MINIMAL: bool> SpecByteLen for VarInt<MINIMAL>

Source§

type T = u64

Source§

impl<const MINIMAL: bool, const N: usize> SpecByteLen for ULeb128<MINIMAL, N>

Source§

type T = nat

Source§

impl<const N: usize> SpecByteLen for Fixed<N>

Source§

type T = Seq<u8>

Source§

impl<const N: usize> SpecByteLen for Const<Fixed<N>, [u8; N]>

Source§

type T = Seq<u8>

Source§

impl<const N: usize, C: SpecByteLen> SpecByteLen for Array<N, C>

Source§

type T = Seq<<C as SpecByteLen>::T>

Source§

impl<const NONDETERMINISTIC: bool, A, B> SpecByteLen for Alt<A, B, NONDETERMINISTIC>
where A: SpecByteLen + Consistency<Val = A::T>, B: SpecByteLen<T = A::T> + Consistency<Val = B::T>,

Source§

type T = <A as SpecByteLen>::T