pub struct Repeat<A, B>(pub A, pub B);Expand description
Zero-or-more A followed by terminator B: sugar for Pair(Star<A>, B).
§Unambiguity
Requires disjoint_domains(A, B).
Tuple Fields§
§0: A§1: BTrait Implementations§
Source§impl<A, B> Consistency for Repeat<A, B>where
A: Consistency,
B: Consistency,
impl<A, B> Consistency for Repeat<A, B>where
A: Consistency,
B: Consistency,
Source§open spec fn consistent(&self, v: Self::Val) -> bool
open spec fn consistent(&self, v: Self::Val) -> bool
{ Pair(super::Star(self.0), self.1).consistent(v) }Source§type Val = (Seq<<A as Consistency>::Val>, <B as Consistency>::Val)
type Val = (Seq<<A as Consistency>::Val>, <B as Consistency>::Val)
The type of values whose consistency is being checked.
Source§impl<A: EquivSerializersGeneral, B: EquivSerializers> EquivSerializers for Repeat<A, B>
impl<A: EquivSerializersGeneral, B: EquivSerializers> EquivSerializers for Repeat<A, B>
Source§impl<A: EquivSerializersGeneral, B: EquivSerializersGeneral> EquivSerializersGeneral for Repeat<A, B>
impl<A: EquivSerializersGeneral, B: EquivSerializersGeneral> EquivSerializersGeneral for Repeat<A, B>
Source§open spec fn equiv_general_inv(&self) -> bool
open spec fn equiv_general_inv(&self) -> bool
{
&&& self.0.equiv_general_inv()
&&& self.1.equiv_general_inv()
}Source§proof fn lemma_serialize_equiv(&self, v: Self::SVal, obuf: Seq<u8>)
proof fn lemma_serialize_equiv(&self, v: Self::SVal, obuf: Seq<u8>)
Source§impl<A: GoodSerializer, B: GoodSerializer> GoodSerializer for Repeat<A, B>
impl<A: GoodSerializer, B: GoodSerializer> GoodSerializer for Repeat<A, B>
Source§open spec fn serialize_inv(&self) -> bool
open spec fn serialize_inv(&self) -> bool
{
&&& self.0.serialize_inv()
&&& self.1.serialize_inv()
}Source§proof fn lemma_serialize_len(&self, v: Self::SVal)
proof fn lemma_serialize_len(&self, v: Self::SVal)
Source§impl<A: NoLookAhead, B: NoLookAhead> NoLookAhead for Repeat<A, B>
impl<A: NoLookAhead, B: NoLookAhead> NoLookAhead for Repeat<A, B>
Source§open spec fn no_lookahead_inv(&self) -> bool
open spec fn no_lookahead_inv(&self) -> bool
{
&&& self.0.no_lookahead_inv()
&&& self.1.no_lookahead_inv()
&&& disjoint_domains(self.0, self.1)
}Source§proof fn lemma_no_lookahead(&self, i1: Seq<u8>, i2: Seq<u8>)
proof fn lemma_no_lookahead(&self, i1: Seq<u8>, i2: Seq<u8>)
Source§impl<A: NonMalleable, B: NonMalleable> NonMalleable for Repeat<A, B>
impl<A: NonMalleable, B: NonMalleable> NonMalleable for Repeat<A, B>
Source§open spec fn nonmal_inv(&self) -> bool
open spec fn nonmal_inv(&self) -> bool
{ Pair(super::Star(self.0), self.1).nonmal_inv() }Source§proof fn lemma_parse_non_malleable(&self, buf1: Seq<u8>, buf2: Seq<u8>)
proof fn lemma_parse_non_malleable(&self, buf1: Seq<u8>, buf2: Seq<u8>)
Source§impl<A: NonTailFmt, B: NonTailFmt> NonTailFmt for Repeat<A, B>
impl<A: NonTailFmt, B: NonTailFmt> NonTailFmt for Repeat<A, B>
Source§open spec fn serialize_dps_inv(&self) -> bool
open spec fn serialize_dps_inv(&self) -> bool
{
&&& self.0.serialize_dps_inv()
&&& self.1.serialize_dps_inv()
}Source§proof fn lemma_serialize_dps_prepend(&self, v: Self::SValue, obuf: Seq<u8>)
proof fn lemma_serialize_dps_prepend(&self, v: Self::SValue, obuf: Seq<u8>)
Source§proof fn lemma_serialize_dps_len(&self, v: Self::SValue, obuf: Seq<u8>)
proof fn lemma_serialize_dps_len(&self, v: Self::SValue, obuf: Seq<u8>)
Source§impl<I, A, B> Parser<I> for Repeat<A, B>
Available on crate feature alloc only.
impl<I, A, B> Parser<I> for Repeat<A, B>
Available on crate feature
alloc only.Source§impl<A: SafeParser, B: Productive> Productive for Repeat<A, B>
impl<A: SafeParser, B: Productive> Productive for Repeat<A, B>
Source§open spec fn productive_inv(&self) -> bool
open spec fn productive_inv(&self) -> bool
{ self.1.productive_inv() }Source§proof fn lemma_productive(&self, s: Seq<u8>)
proof fn lemma_productive(&self, s: Seq<u8>)
Source§impl<A: SPRoundTripDps + NonTailFmt, B: SPRoundTripDps> SPRoundTripDps for Repeat<A, B>
impl<A: SPRoundTripDps + NonTailFmt, B: SPRoundTripDps> SPRoundTripDps for Repeat<A, B>
Source§open spec fn unambiguous(&self) -> bool
open spec fn unambiguous(&self) -> bool
{
&&& self.0.serialize_dps_inv()
&&& self.0.unambiguous()
&&& self.1.unambiguous()
&&& disjoint_domains(self.0, self.1)
}Source§proof fn theorem_serialize_dps_parse_roundtrip(&self, v: Self::T, obuf: Seq<u8>)
proof fn theorem_serialize_dps_parse_roundtrip(&self, v: Self::T, obuf: Seq<u8>)
Source§impl<A, B> SafeParser for Repeat<A, B>where
A: SafeParser,
B: SafeParser,
impl<A, B> SafeParser for Repeat<A, B>where
A: SafeParser,
B: SafeParser,
Source§impl<Output: OutputBuf, A, B, TA, TB> Serializer<Output, (&[TA], TB)> for Repeat<A, B>
impl<Output: OutputBuf, A, B, TA, TB> Serializer<Output, (&[TA], TB)> for Repeat<A, B>
Source§exec fn serialize_into(&self, v: &(&[TA], TB), obuf: &mut Output)
exec fn serialize_into(&self, v: &(&[TA], TB), obuf: &mut Output)
Source§impl<A, B> SoundParser for Repeat<A, B>where
A: SoundParser,
B: SoundParser,
impl<A, B> SoundParser for Repeat<A, B>where
A: SoundParser,
B: SoundParser,
Source§impl<A: SpecByteLen, B: SpecByteLen> SpecByteLen for Repeat<A, B>
impl<A: SpecByteLen, B: SpecByteLen> SpecByteLen for Repeat<A, B>
Source§impl<A: SpecParser, B: SpecParser> SpecParser for Repeat<A, B>
impl<A: SpecParser, B: SpecParser> SpecParser for Repeat<A, B>
Source§open spec fn spec_parse(&self, ibuf: Seq<u8>) -> Option<(int, Self::PVal)>
open spec fn spec_parse(&self, ibuf: Seq<u8>) -> Option<(int, Self::PVal)>
{ Pair(super::Star(self.0), self.1).spec_parse(ibuf) }Source§type PVal = (Seq<<A as SpecParser>::PVal>, <B as SpecParser>::PVal)
type PVal = (Seq<<A as SpecParser>::PVal>, <B as SpecParser>::PVal)
The type of parsed values.
Source§impl<A: SpecSerializer, B: SpecSerializer> SpecSerializer for Repeat<A, B>
impl<A: SpecSerializer, B: SpecSerializer> SpecSerializer for Repeat<A, B>
Source§open spec fn spec_serialize(&self, v: Self::SVal) -> Seq<u8>
open spec fn spec_serialize(&self, v: Self::SVal) -> Seq<u8>
{ Pair(super::Star(self.0), self.1).spec_serialize(v) }Source§type SVal = (Seq<<A as SpecSerializer>::SVal>, <B as SpecSerializer>::SVal)
type SVal = (Seq<<A as SpecSerializer>::SVal>, <B as SpecSerializer>::SVal)
The type of values to be serialized.
Source§impl<A: SpecSerializerDps, B: SpecSerializerDps> SpecSerializerDps for Repeat<A, B>
impl<A: SpecSerializerDps, B: SpecSerializerDps> SpecSerializerDps for Repeat<A, B>
Source§open spec fn spec_serialize_dps(&self, vs: Self::SValue, obuf: Seq<u8>) -> Seq<u8>
open spec fn spec_serialize_dps(&self, vs: Self::SValue, obuf: Seq<u8>) -> Seq<u8>
{ Pair(super::Star(self.0), self.1).spec_serialize_dps(vs, obuf) }Source§type SValue = (Seq<<A as SpecSerializerDps>::SValue>, <B as SpecSerializerDps>::SValue)
type SValue = (Seq<<A as SpecSerializerDps>::SValue>, <B as SpecSerializerDps>::SValue)
The type of values to be serialized.
Source§impl<A: ValueByteLen, B: ValueByteLen> ValueByteLen for Repeat<A, B>
impl<A: ValueByteLen, B: ValueByteLen> ValueByteLen for Repeat<A, B>
Source§open spec fn value_byte_len(v: Self::T) -> nat
open spec fn value_byte_len(v: Self::T) -> nat
{ <Pair<super::Star<A>, B> as ValueByteLen>::value_byte_len(v) }Source§proof fn lemma_value_len_matches_byte_len(&self, v: Self::T)
proof fn lemma_value_len_matches_byte_len(&self, v: Self::T)
impl<A: Copy, B: Copy> Copy for Repeat<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for Repeat<A, B>
impl<A, B> RefUnwindSafe for Repeat<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Repeat<A, B>
impl<A, B> Sync for Repeat<A, B>
impl<A, B> Unpin for Repeat<A, B>
impl<A, B> UnsafeUnpin for Repeat<A, B>where
A: UnsafeUnpin,
B: UnsafeUnpin,
impl<A, B> UnwindSafe for Repeat<A, B>where
A: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: From<T>,
impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: From<T>,
fn obeys_from_spec() -> bool
fn from_spec(v: T) -> VERUS_SPEC__A
§impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: Into<T>,
impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: Into<T>,
fn obeys_into_spec() -> bool
fn into_spec(self) -> T
§impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
fn obeys_into_spec() -> bool
fn into_spec(self) -> U
Source§impl<C> NonAmbiguous for Cwhere
C: SPRoundTrip,
impl<C> NonAmbiguous for Cwhere
C: SPRoundTrip,
Source§open spec fn nonamb_inv(&self) -> bool
open spec fn nonamb_inv(&self) -> bool
{ self.sp_roundtrip_inv() }Source§proof fn lemma_serialize_injective(
&self,
v1: <C as Consistency>::Val,
v2: <C as Consistency>::Val,
)
proof fn lemma_serialize_injective( &self, v1: <C as Consistency>::Val, v2: <C as Consistency>::Val, )
Source§impl<C> PSRoundTrip for C
impl<C> PSRoundTrip for C
Source§open spec fn ps_roundtrip_inv(&self) -> bool
open spec fn ps_roundtrip_inv(&self) -> bool
{ self.safe_inv() && self.sound_inv() && self.nonmal_inv() && self.sp_roundtrip_inv() }Source§proof fn theorem_parse_serialize_roundtrip(&self, ibuf: Seq<u8>)
proof fn theorem_parse_serialize_roundtrip(&self, ibuf: Seq<u8>)
Source§impl<C> SPRoundTrip for C
impl<C> SPRoundTrip for C
Source§open spec fn sp_roundtrip_inv(&self) -> bool
open spec fn sp_roundtrip_inv(&self) -> bool
{ self.serialize_inv() && self.equiv_inv() && self.unambiguous() }