pub struct TVOr<Tag, C, Rest>(pub Tag, pub C, pub Rest);Expand description
One of the dependent family of combinators
Typically used to build linear chains of tagged unions: TVOr(0x01u8, fmt1, TVOr(0x02u8, fmt2, Uninhabited()))
Tuple Fields§
§0: Tag§1: C§2: RestTrait Implementations§
Source§impl<Tag, C, Rest> DepCombinator for TVOr<Tag, C, Rest>where
C: Consistency,
Rest: DepCombinator<Key = Tag>,
impl<Tag, C, Rest> DepCombinator for TVOr<Tag, C, Rest>where
C: Consistency,
Rest: DepCombinator<Key = Tag>,
Source§open spec fn apply(&self, key: Self::Key) -> Self::Body
open spec fn apply(&self, key: Self::Key) -> Self::Body
{ Choice(Cond(key == self.0, self.1), self.2.apply(key)) }Source§open spec fn recover(&self, value: Self::Val) -> Self::Key
open spec fn recover(&self, value: Self::Val) -> Self::Key
{
match value {
Sum::Inl(_) => self.0,
Sum::Inr(vr) => self.2.recover(vr),
}
}Source§open spec fn recover_inv(&self) -> bool
open spec fn recover_inv(&self) -> bool
{ self.2.recover_inv() }Source§proof fn lemma_recover_consistent(&self, key: Self::Key, value: Self::Val)
proof fn lemma_recover_consistent(&self, key: Self::Key, value: Self::Val)
Source§type Key = Tag
type Key = Tag
The type of keys parsed by the head combinator/to be recovered during serialization.
Source§type Val = Sum<<C as Consistency>::Val, <Rest as DepCombinator>::Val>
type Val = Sum<<C as Consistency>::Val, <Rest as DepCombinator>::Val>
The type of values consumed/produced by the body combinator.
Auto Trait Implementations§
impl<Tag, C, Rest> Freeze for TVOr<Tag, C, Rest>
impl<Tag, C, Rest> RefUnwindSafe for TVOr<Tag, C, Rest>
impl<Tag, C, Rest> Send for TVOr<Tag, C, Rest>
impl<Tag, C, Rest> Sync for TVOr<Tag, C, Rest>
impl<Tag, C, Rest> Unpin for TVOr<Tag, C, Rest>
impl<Tag, C, Rest> UnsafeUnpin for TVOr<Tag, C, Rest>
impl<Tag, C, Rest> UnwindSafe for TVOr<Tag, C, Rest>
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