Skip to main content

SpecParser

Trait SpecParser 

Source
pub trait SpecParser {
    type PVal;

    // Required method
    spec fn spec_parse(&self, ibuf: Seq<u8>) -> Option<(int, Self::PVal)>;
}
Expand description

Parser specification.

Required Associated Types§

Source

type PVal

The type of parsed values.

Required Methods§

Source

spec fn spec_parse(&self, ibuf: Seq<u8>) -> Option<(int, Self::PVal)>

Attempts to parse a value from ibuf.

Returns Some((n, v)) on success, where n bytes were consumed and v is the parsed value, or None on failure.

Implementations on Foreign Types§

Source§

impl<P: SpecParser> SpecParser for &P

Source§

open spec fn spec_parse(&self, ibuf: Seq<u8>) -> Option<(int, Self::PVal)>

{ (*self).spec_parse(ibuf) }
Source§

type PVal = <P as SpecParser>::PVal

Source§

impl<Spec, Exec> SpecParser for (Spec, Exec)
where Spec: SpecParser,

Source§

open spec fn spec_parse(&self, ibuf: Seq<u8>) -> Option<(int, Self::PVal)>

{ self.0.spec_parse(ibuf) }
Source§

type PVal = <Spec as SpecParser>::PVal

Implementors§

Source§

impl SpecParser for BerEndFmt

Source§

impl SpecParser for Integer8Fmt

Source§

impl SpecParser for Integer16Fmt

Source§

impl SpecParser for BerLengthFmt

Source§

impl SpecParser for BmpStringFmt

Source§

impl SpecParser for EnumeratedFmt

Source§

type PVal = int

Source§

impl SpecParser for Ia5StringFmt

Source§

impl SpecParser for IntegerFmt

Source§

type PVal = int

Source§

impl SpecParser for ObjectIdentifierFmt

Source§

impl SpecParser for PrintableStringFmt

Source§

impl SpecParser for TagFmt

Source§

impl SpecParser for TeletexStringFmt

Source§

impl SpecParser for UniversalStringFmt

Source§

type PVal = Seq<char>

Source§

impl SpecParser for Utf8StringFmt

Source§

type PVal = Seq<char>

Source§

impl SpecParser for CborInitialFmt

Source§

impl SpecParser for Empty

Source§

impl SpecParser for Void

Source§

impl SpecParser for I8

Source§

impl SpecParser for I16Be

Source§

impl SpecParser for I16Le

Source§

impl SpecParser for I32Be

Source§

impl SpecParser for I32Le

Source§

impl SpecParser for I64Be

Source§

impl SpecParser for I64Le

Source§

impl SpecParser for Eof

Source§

impl SpecParser for Tail

Source§

type PVal = Seq<u8>

Source§

impl SpecParser for U8

Source§

impl SpecParser for U16Be

Source§

impl SpecParser for U16Le

Source§

impl SpecParser for U24Be

Source§

impl SpecParser for U24Le

Source§

impl SpecParser for U32Be

Source§

impl SpecParser for U32Le

Source§

impl SpecParser for U64Be

Source§

impl SpecParser for U64Le

Source§

impl<A> SpecParser for Opt<A>
where A: SpecParser,

Source§

impl<A, B> SpecParser for PairRev<A, B>
where A: SpecParser, B: StaticByteLen + SpecParser<PVal = B::T>,

Source§

type PVal = (<A as SpecParser>::PVal, <B as SpecParser>::PVal)

Source§

impl<A, B> SpecParser for Bind<A, B>
where A: SpecParser, B: SpecMap<Input = A::PVal>, B::Output: SpecParser,

Source§

type PVal = (<A as SpecParser>::PVal, <<B as SpecMap>::Output as SpecParser>::PVal)

Source§

impl<A, B> SpecParser for Pair<A, B>
where A: SpecParser, B: SpecParser,

Source§

type PVal = (<A as SpecParser>::PVal, <B as SpecParser>::PVal)

Source§

impl<A, B, C> SpecParser for Permute3<A, B, C>
where A: SpecParser, B: SpecParser, C: SpecParser,

Source§

type PVal = (<A as SpecParser>::PVal, (<B as SpecParser>::PVal, <C as SpecParser>::PVal))

Source§

impl<A, B, C, D> SpecParser for Permute4<A, B, C, D>

Source§

type PVal = (<A as SpecParser>::PVal, (<B as SpecParser>::PVal, (<C as SpecParser>::PVal, <D as SpecParser>::PVal)))

Source§

impl<A, B, C, D, E> SpecParser for Permute5<A, B, C, D, E>

Source§

type PVal = (<A as SpecParser>::PVal, (<B as SpecParser>::PVal, (<C as SpecParser>::PVal, (<D as SpecParser>::PVal, <E as SpecParser>::PVal))))

Source§

impl<A, B, const CHECK: bool> SpecParser for Preceded<A, A::PVal, B, CHECK>
where A: SpecParser, B: SpecParser,

Source§

impl<A, B, const CHECK: bool> SpecParser for Terminated<A, B, B::PVal, CHECK>
where A: SpecParser, B: SpecParser,

Source§

impl<A, Pred> SpecParser for Refined<A, Pred>
where A: SpecParser, Pred: SpecPred<A::PVal>,

Source§

impl<A, Then> SpecParser for AndThen<A, Then>
where A: SpecParser<PVal = Seq<u8>>, Then: SpecParser,

Source§

type PVal = <Then as SpecParser>::PVal

Source§

impl<A: SpecParser> SpecParser for Star<A>

Source§

type PVal = Seq<<A as SpecParser>::PVal>

Source§

impl<A: SpecParser, B: SpecParser> SpecParser for Sum<A, B>

Source§

type PVal = Sum<<A as SpecParser>::PVal, <B as SpecParser>::PVal>

Source§

impl<A: SpecParser, B: SpecParser> SpecParser for Choice<A, B>

Source§

type PVal = Sum<<A as SpecParser>::PVal, <B as SpecParser>::PVal>

Source§

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

Source§

type PVal = (Option<<A as SpecParser>::PVal>, <B as SpecParser>::PVal)

Source§

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

Source§

type PVal = (Seq<<A as SpecParser>::PVal>, <B as SpecParser>::PVal)

Source§

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

Source§

type PVal = <C as SpecByteLen>::T

Source§

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

Source§

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

Source§

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

Source§

type PVal = <C as SpecByteLen>::T

Source§

impl<C: SpecParser> SpecParser for SetOfFmt<C>

Source§

type PVal = Seq<<C as SpecParser>::PVal>

Source§

impl<C: SpecParser> SpecParser for OptionalEnd<C>

Source§

impl<C: SpecParser> SpecParser for RepeatTillEnd<C>

Source§

type PVal = Seq<<C as SpecParser>::PVal>

Source§

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

Source§

type PVal = Seq<<C as SpecParser>::PVal>

Source§

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

Source§

type PVal = <Content as SpecParser>::PVal

Source§

impl<F> SpecParser for ImplicitlyTaggedFmt<F>

Source§

impl<Field, Rest, const DER: bool> SpecParser for DefaultedFmt<Field, Field::PVal, Rest, DER>
where Field: SpecByteLen + SpecParser<PVal = Field::T>, Rest: SpecByteLen + SpecParser<PVal = Rest::T>,

Source§

type PVal = (<Field as SpecParser>::PVal, <Rest as SpecParser>::PVal)

Source§

impl<Head, Tail> SpecParser for Implicit<Head, Tail>
where Head: SpecParser, Tail: DepCombinator<Key = Head::PVal>, Tail::Body: SpecParser<PVal = Tail::Val>,

Source§

type PVal = <Tail as DepCombinator>::Val

Source§

impl<I, O, Spec, Exec> SpecParser for FnParser<I, O, Spec, Exec>
where I: View<V = Seq<u8>>, O: DeepView, Spec: SpecParser<PVal = O::V>, Exec: Fn(&I) -> PResult<O>,

Source§

type PVal = <O as DeepView>::V

Source§

impl<Inner> SpecParser for Const<Inner, Inner::PVal>
where Inner: SpecParser,

Source§

type PVal = <Inner as SpecParser>::PVal

Source§

impl<Inner, M> SpecParser for Mapped<Inner, M>
where Inner: SpecParser, M: SpecMapper<In = Inner::PVal>,

Source§

type PVal = <M as SpecMapper>::Out

Source§

impl<Inner, M> SpecParser for TryMap<Inner, M>
where Inner: SpecParser, M: SpecMapper<In = Inner::PVal>,

Source§

type PVal = <M as SpecMapper>::Out

Source§

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

Source§

type PVal = <M as SpecMap>::Output

Source§

impl<Inner: SpecParser> SpecParser for Cond<Inner>

Source§

type PVal = <Inner as SpecParser>::PVal

Source§

impl<Inner: SpecParser> SpecParser for Named<Inner>

Source§

type PVal = <Inner as SpecParser>::PVal

Source§

impl<Inner: SpecParser> SpecParser for Ref<Inner>

Source§

type PVal = <Inner as SpecParser>::PVal

Source§

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

Source§

type PVal = <Inner as SpecParser>::PVal

Source§

impl<Inner: SpecParser, Out> SpecParser for Mapped<Inner, FnSpec<(Inner::PVal,), Out>>

Source§

type PVal = Out

Source§

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

Source§

type PVal = Seq<u8>

Source§

impl<Of, Tg> SpecParser for SuffixTagged<Of, Tg, Tg::T>
where Tg: SpecByteLen + SpecParser<PVal = Tg::T>, Of: SpecParser,

Source§

type PVal = <Of as SpecParser>::PVal

Source§

impl<P1, P2> SpecParser for Permute2<P1, P2>
where P1: SpecParser, P2: SpecParser,

Source§

type PVal = (<P1 as SpecParser>::PVal, <P2 as SpecParser>::PVal)

Source§

impl<Repr, Tuple, Nominal> SpecParser for Bits<Repr, Tuple, Nominal>
where Repr: SpecByteLen + SpecParser<PVal = Repr::T>,

Source§

type PVal = Nominal

Source§

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

Source§

type PVal = <Blen as SpecByteLen>::T

Source§

impl<T> SpecParser for BundledSpecs<T>

Source§

type PVal = T

Source§

impl<T> SpecParser for ParserFnSpec<T>

Source§

type PVal = T

Source§

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

Source§

impl<Tg, Of> SpecParser for PrefixTagged<Tg, Tg::T, Of>
where Tg: SpecByteLen + SpecParser<PVal = Tg::T>, Of: SpecParser,

Source§

type PVal = <Of as SpecParser>::PVal

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type PVal = nat

Source§

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

Source§

type PVal = Seq<u8>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type PVal = Seq<u8>

Source§

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

Source§

type PVal = <Body as SpecRecBody>::T

Source§

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

Source§

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

Source§

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

Source§

type PVal = nat

Source§

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

Source§

type PVal = Seq<u8>

Source§

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

Source§

type PVal = Seq<u8>

Source§

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

Source§

type PVal = Seq<<C as SpecParser>::PVal>

Source§

impl<const NONDETERMINISTIC: bool, A: SpecParser, B: SpecParser<PVal = A::PVal>> SpecParser for Alt<A, B, NONDETERMINISTIC>