DisjointFrom

Trait DisjointFrom 

Source
pub trait DisjointFrom<Other>
where Self: SpecCombinator, Other: SpecCombinator,
{ // Required methods spec fn disjoint_from(&self, other: &Other) -> bool; proof fn parse_disjoint_on(&self, other: &Other, buf: Seq<u8>); }
Expand description

A helper trait for Choice combinator.

Required Methods§

Source

spec fn disjoint_from(&self, other: &Other) -> bool

pre-condition that must be held for Self and [Other] to be disjoint

Source

proof fn parse_disjoint_on(&self, other: &Other, buf: Seq<u8>)

requires
self.disjoint_from(other),
ensures
self.spec_parse(buf) is Some ==> other.spec_parse(buf) is None,

The combinator Self is disjoint from the combinator [Other] if the bytes buf can be parsed by Self but not by [Other]

Implementations on Foreign Types§

Source§

impl<'a, 'b, T1, T2> DisjointFrom<&'a T1> for &'b T2

Source§

open spec fn disjoint_from(&self, other: &&T1) -> bool

{ (*self).disjoint_from(*other) }
Source§

proof fn parse_disjoint_on(&self, other: &&T1, buf: Seq<u8>)

Source§

impl<U1, U2, V1, V2> DisjointFrom<(U2, V2)> for (U1, V1)

Source§

open spec fn disjoint_from(&self, other: &(U2, V2)) -> bool

{ self.0.disjoint_from(&other.0) }
Source§

proof fn parse_disjoint_on(&self, other: &(U2, V2), buf: Seq<u8>)

Implementors§

Source§

impl<C, Fst, Snd> DisjointFrom<C> for OptThen<Fst, Snd>

Source§

impl<Inner1, Inner2> DisjointFrom<Cond<Inner2>> for Cond<Inner1>
where Inner1: SpecCombinator, Inner2: SpecCombinator,

Source§

impl<Inner, P1, P2> DisjointFrom<Refined<Inner, P2>> for Refined<Inner, P1>
where Inner: SpecCombinator, P1: SpecPred<Inner::Type>, P2: SpecPred<Inner::Type>,

Source§

impl<Inner, T> DisjointFrom<Tag<Inner, T>> for Tag<Inner, T>
where Inner: SpecCombinator<Type = T>,

Source§

impl<S1, S2, S3> DisjointFrom<S3> for Choice<S1, S2>

Source§

impl<T> DisjointFrom<T> for End

Source§

impl<T> DisjointFrom<T> for Fail
where T: SpecCombinator,

Source§

impl<U1, U2, M1, M2> DisjointFrom<Mapped<U2, M2>> for Mapped<U1, M1>
where U1: DisjointFrom<U2>, U2: SpecCombinator, M1: SpecIso<Src = U1::Type>, M2: SpecIso<Src = U2::Type>, U1::Type: SpecFrom<M1::Dst>, U2::Type: SpecFrom<M2::Dst>, M1::Dst: SpecFrom<U1::Type>, M2::Dst: SpecFrom<U2::Type>,

Source§

impl<U1, U2, V1, V2> DisjointFrom<Pair<U2, V2, FnSpec<(<U2 as SpecCombinator>::Type,), V2>>> for SpecPair<U1, V1>

Source§

impl<U1, U2, V1, V2> DisjointFrom<Preceded<U2, V2>> for Preceded<U1, V1>

Source§

impl<U, M1, M2> DisjointFrom<TryMap<U, M2>> for TryMap<U, M1>
where U: SpecCombinator, M1: SpecPartialIsoFn<Src = U::Type>, M2: SpecPartialIsoFn<Src = U::Type>, U::Type: SpecTryFrom<M1::Dst> + SpecTryFrom<M2::Dst>, M1::Dst: SpecTryFrom<U::Type>, M2::Dst: SpecTryFrom<U::Type>,