pub struct Tag<Inner, T>(pub Refined<Inner, TagPred<T>>);Expand description
Generic tag combinator that matches the input with a given value and discards it
e.g. Tag(U8, 0) matches the byte 0; Tag(Fixed::<3>, &[1, 2, 3]) matches the
bytes [1, 2, 3]
Tuple Fields§
§0: Refined<Inner, TagPred<T>>Implementations§
Trait Implementations§
Source§impl<'x, const N: usize> Combinator<'x, &'x [u8], Vec<u8>> for Tag<Fixed<N>, [u8; N]>
impl<'x, const N: usize> Combinator<'x, &'x [u8], Vec<u8>> for Tag<Fixed<N>, [u8; N]>
Source§open spec fn ex_requires(&self) -> bool
open spec fn ex_requires(&self) -> bool
{ <_ as Combinator<'x, &'x [u8], Vec<u8>>>::ex_requires(&self.0) }Source§exec fn serialize(
&self,
v: Self::SType,
data: &mut Vec<u8>,
pos: usize,
) -> Result<usize, SerializeError>
exec fn serialize( &self, v: Self::SType, data: &mut Vec<u8>, pos: usize, ) -> Result<usize, SerializeError>
Source§type SType = ()
type SType = ()
The input type of serialization, often a reference to
Self::Type.
For “structural” formats though (e.g., crate::regular::sequence::Pair and crate::regular::variant::Choice),
this is the tuple/sum of the corresponding Combinator::SType types.Source§impl<'x, I, O> Combinator<'x, I, O> for Tag<U16Be, u16>where
I: VestPublicInput,
O: VestPublicOutput<I>,
impl<'x, I, O> Combinator<'x, I, O> for Tag<U16Be, u16>where
I: VestPublicInput,
O: VestPublicOutput<I>,
Source§open spec fn ex_requires(&self) -> bool
open spec fn ex_requires(&self) -> bool
{ <_ as Combinator<'x, I, O>>::ex_requires(&self.0) }Source§exec fn serialize(
&self,
v: Self::SType,
data: &mut O,
pos: usize,
) -> Result<usize, SerializeError>
exec fn serialize( &self, v: Self::SType, data: &mut O, pos: usize, ) -> Result<usize, SerializeError>
Source§type SType = ()
type SType = ()
The input type of serialization, often a reference to
Self::Type.
For “structural” formats though (e.g., crate::regular::sequence::Pair and crate::regular::variant::Choice),
this is the tuple/sum of the corresponding Combinator::SType types.Source§impl<'x, I, O> Combinator<'x, I, O> for Tag<U16Le, u16>where
I: VestPublicInput,
O: VestPublicOutput<I>,
impl<'x, I, O> Combinator<'x, I, O> for Tag<U16Le, u16>where
I: VestPublicInput,
O: VestPublicOutput<I>,
Source§open spec fn ex_requires(&self) -> bool
open spec fn ex_requires(&self) -> bool
{ <_ as Combinator<'x, I, O>>::ex_requires(&self.0) }Source§exec fn serialize(
&self,
v: Self::SType,
data: &mut O,
pos: usize,
) -> Result<usize, SerializeError>
exec fn serialize( &self, v: Self::SType, data: &mut O, pos: usize, ) -> Result<usize, SerializeError>
Source§type SType = ()
type SType = ()
The input type of serialization, often a reference to
Self::Type.
For “structural” formats though (e.g., crate::regular::sequence::Pair and crate::regular::variant::Choice),
this is the tuple/sum of the corresponding Combinator::SType types.Source§impl<'x, I, O> Combinator<'x, I, O> for Tag<U32Be, u32>where
I: VestPublicInput,
O: VestPublicOutput<I>,
impl<'x, I, O> Combinator<'x, I, O> for Tag<U32Be, u32>where
I: VestPublicInput,
O: VestPublicOutput<I>,
Source§open spec fn ex_requires(&self) -> bool
open spec fn ex_requires(&self) -> bool
{ <_ as Combinator<'x, I, O>>::ex_requires(&self.0) }Source§exec fn serialize(
&self,
v: Self::SType,
data: &mut O,
pos: usize,
) -> Result<usize, SerializeError>
exec fn serialize( &self, v: Self::SType, data: &mut O, pos: usize, ) -> Result<usize, SerializeError>
Source§type SType = ()
type SType = ()
The input type of serialization, often a reference to
Self::Type.
For “structural” formats though (e.g., crate::regular::sequence::Pair and crate::regular::variant::Choice),
this is the tuple/sum of the corresponding Combinator::SType types.Source§impl<'x, I, O> Combinator<'x, I, O> for Tag<U32Le, u32>where
I: VestPublicInput,
O: VestPublicOutput<I>,
impl<'x, I, O> Combinator<'x, I, O> for Tag<U32Le, u32>where
I: VestPublicInput,
O: VestPublicOutput<I>,
Source§open spec fn ex_requires(&self) -> bool
open spec fn ex_requires(&self) -> bool
{ <_ as Combinator<'x, I, O>>::ex_requires(&self.0) }Source§exec fn serialize(
&self,
v: Self::SType,
data: &mut O,
pos: usize,
) -> Result<usize, SerializeError>
exec fn serialize( &self, v: Self::SType, data: &mut O, pos: usize, ) -> Result<usize, SerializeError>
Source§type SType = ()
type SType = ()
The input type of serialization, often a reference to
Self::Type.
For “structural” formats though (e.g., crate::regular::sequence::Pair and crate::regular::variant::Choice),
this is the tuple/sum of the corresponding Combinator::SType types.Source§impl<'x, I, O> Combinator<'x, I, O> for Tag<U64Be, u64>where
I: VestPublicInput,
O: VestPublicOutput<I>,
impl<'x, I, O> Combinator<'x, I, O> for Tag<U64Be, u64>where
I: VestPublicInput,
O: VestPublicOutput<I>,
Source§open spec fn ex_requires(&self) -> bool
open spec fn ex_requires(&self) -> bool
{ <_ as Combinator<'x, I, O>>::ex_requires(&self.0) }Source§exec fn serialize(
&self,
v: Self::SType,
data: &mut O,
pos: usize,
) -> Result<usize, SerializeError>
exec fn serialize( &self, v: Self::SType, data: &mut O, pos: usize, ) -> Result<usize, SerializeError>
Source§type SType = ()
type SType = ()
The input type of serialization, often a reference to
Self::Type.
For “structural” formats though (e.g., crate::regular::sequence::Pair and crate::regular::variant::Choice),
this is the tuple/sum of the corresponding Combinator::SType types.Source§impl<'x, I, O> Combinator<'x, I, O> for Tag<U64Le, u64>where
I: VestPublicInput,
O: VestPublicOutput<I>,
impl<'x, I, O> Combinator<'x, I, O> for Tag<U64Le, u64>where
I: VestPublicInput,
O: VestPublicOutput<I>,
Source§open spec fn ex_requires(&self) -> bool
open spec fn ex_requires(&self) -> bool
{ <_ as Combinator<'x, I, O>>::ex_requires(&self.0) }Source§exec fn serialize(
&self,
v: Self::SType,
data: &mut O,
pos: usize,
) -> Result<usize, SerializeError>
exec fn serialize( &self, v: Self::SType, data: &mut O, pos: usize, ) -> Result<usize, SerializeError>
Source§type SType = ()
type SType = ()
The input type of serialization, often a reference to
Self::Type.
For “structural” formats though (e.g., crate::regular::sequence::Pair and crate::regular::variant::Choice),
this is the tuple/sum of the corresponding Combinator::SType types.Source§impl<'x, I, O> Combinator<'x, I, O> for Tag<U8, u8>where
I: VestPublicInput,
O: VestPublicOutput<I>,
impl<'x, I, O> Combinator<'x, I, O> for Tag<U8, u8>where
I: VestPublicInput,
O: VestPublicOutput<I>,
Source§open spec fn ex_requires(&self) -> bool
open spec fn ex_requires(&self) -> bool
{ <_ as Combinator<'x, I, O>>::ex_requires(&self.0) }Source§exec fn serialize(
&self,
v: Self::SType,
data: &mut O,
pos: usize,
) -> Result<usize, SerializeError>
exec fn serialize( &self, v: Self::SType, data: &mut O, pos: usize, ) -> Result<usize, SerializeError>
Source§type SType = ()
type SType = ()
The input type of serialization, often a reference to
Self::Type.
For “structural” formats though (e.g., crate::regular::sequence::Pair and crate::regular::variant::Choice),
this is the tuple/sum of the corresponding Combinator::SType types.Source§impl<'x, I, O> Combinator<'x, I, O> for Tag<UnsignedLEB128, UInt>where
I: VestPublicInput,
O: VestPublicOutput<I>,
impl<'x, I, O> Combinator<'x, I, O> for Tag<UnsignedLEB128, UInt>where
I: VestPublicInput,
O: VestPublicOutput<I>,
Source§open spec fn ex_requires(&self) -> bool
open spec fn ex_requires(&self) -> bool
{ <_ as Combinator<'x, I, O>>::ex_requires(&self.0) }Source§exec fn serialize(
&self,
v: Self::SType,
data: &mut O,
pos: usize,
) -> Result<usize, SerializeError>
exec fn serialize( &self, v: Self::SType, data: &mut O, pos: usize, ) -> Result<usize, SerializeError>
Source§type SType = ()
type SType = ()
The input type of serialization, often a reference to
Self::Type.
For “structural” formats though (e.g., crate::regular::sequence::Pair and crate::regular::variant::Choice),
this is the tuple/sum of the corresponding Combinator::SType types.Source§impl<Inner, T> DisjointFrom<Tag<Inner, T>> for Tag<Inner, T>where
Inner: SpecCombinator<Type = T>,
impl<Inner, T> DisjointFrom<Tag<Inner, T>> for Tag<Inner, T>where
Inner: SpecCombinator<Type = T>,
Source§open spec fn disjoint_from(&self, other: &Tag<Inner, T>) -> bool
open spec fn disjoint_from(&self, other: &Tag<Inner, T>) -> bool
{ self.0.disjoint_from(&other.0) }Source§proof fn parse_disjoint_on(&self, other: &Tag<Inner, T>, buf: Seq<u8>)
proof fn parse_disjoint_on(&self, other: &Tag<Inner, T>, buf: Seq<u8>)
Source§impl<Inner: SecureSpecCombinator<Type = T>, T> SecureSpecCombinator for Tag<Inner, T>
impl<Inner: SecureSpecCombinator<Type = T>, T> SecureSpecCombinator for Tag<Inner, T>
Source§open spec fn is_prefix_secure() -> bool
open spec fn is_prefix_secure() -> bool
{ Inner::is_prefix_secure() }Source§open spec fn is_productive(&self) -> bool
open spec fn is_productive(&self) -> bool
{ self.0.is_productive() }Source§proof fn theorem_serialize_parse_roundtrip(&self, v: Self::Type)
proof fn theorem_serialize_parse_roundtrip(&self, v: Self::Type)
Source§proof fn theorem_parse_serialize_roundtrip(&self, buf: Seq<u8>)
proof fn theorem_parse_serialize_roundtrip(&self, buf: Seq<u8>)
Source§proof fn lemma_prefix_secure(&self, s1: Seq<u8>, s2: Seq<u8>)
proof fn lemma_prefix_secure(&self, s1: Seq<u8>, s2: Seq<u8>)
Source§proof fn lemma_parse_length(&self, s: Seq<u8>)
proof fn lemma_parse_length(&self, s: Seq<u8>)
Source§proof fn lemma_parse_productive(&self, s: Seq<u8>)
proof fn lemma_parse_productive(&self, s: Seq<u8>)
Source§fn corollary_parse_surjective(&self, v: Self::Type)
fn corollary_parse_surjective(&self, v: Self::Type)
Source§fn corollary_serialize_injective_contraposition(
&self,
v1: Self::Type,
v2: Self::Type,
)
fn corollary_serialize_injective_contraposition( &self, v1: Self::Type, v2: Self::Type, )
Source§fn lemma_serialize_productive(&self, v: Self::Type)
fn lemma_serialize_productive(&self, v: Self::Type)
Source§impl<Inner: SpecCombinator<Type = T>, T> SpecCombinator for Tag<Inner, T>
impl<Inner: SpecCombinator<Type = T>, T> SpecCombinator for Tag<Inner, T>
Auto Trait Implementations§
impl<Inner, T> Freeze for Tag<Inner, T>
impl<Inner, T> RefUnwindSafe for Tag<Inner, T>where
Inner: RefUnwindSafe,
T: RefUnwindSafe,
impl<Inner, T> Send for Tag<Inner, T>
impl<Inner, T> Sync for Tag<Inner, T>
impl<Inner, T> Unpin for Tag<Inner, T>
impl<Inner, T> UnwindSafe for Tag<Inner, T>where
Inner: UnwindSafe,
T: 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
§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<T, U> SpecTryInto<U> for Twhere
U: SpecTryFrom<T>,
impl<T, U> SpecTryInto<U> for Twhere
U: SpecTryFrom<T>,
Source§open spec fn spec_try_into(self) -> Result<U, <U as SpecTryFrom<T>>::Error>
open spec fn spec_try_into(self) -> Result<U, <U as SpecTryFrom<T>>::Error>
{ U::spec_try_from(self) }Source§type Error = <U as SpecTryFrom<T>>::Error
type Error = <U as SpecTryFrom<T>>::Error
The type returned in the event of a conversion error.