pub struct TagValNode<Tag, Left, Right>(pub Left, pub Right, pub PhantomData<Tag>);Expand description
One of the dependent family of combinators
Balanced binary tree node for tag-value choices.
Tuple Fields§
§0: Left§1: Right§2: PhantomData<Tag>Trait Implementations§
Source§impl<Tag, Left, Right> DepCombinator for TagValNode<Tag, Left, Right>where
Left: DepCombinator<Key = Tag>,
Right: DepCombinator<Key = Tag>,
impl<Tag, Left, Right> DepCombinator for TagValNode<Tag, Left, Right>where
Left: DepCombinator<Key = Tag>,
Right: 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(self.0.apply(key), self.1.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(vl) => self.0.recover(vl),
Sum::Inr(vr) => self.1.recover(vr),
}
}Source§open spec fn recover_inv(&self) -> bool
open spec fn recover_inv(&self) -> bool
{ self.0.recover_inv() && self.1.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<<Left as DepCombinator>::Val, <Right as DepCombinator>::Val>
type Val = Sum<<Left as DepCombinator>::Val, <Right as DepCombinator>::Val>
The type of values consumed/produced by the body combinator.
Source§type Body = Choice<<Left as DepCombinator>::Body, <Right as DepCombinator>::Body>
type Body = Choice<<Left as DepCombinator>::Body, <Right as DepCombinator>::Body>
The type of the body combinator produced by
apply.Auto Trait Implementations§
impl<Tag, Left, Right> Freeze for TagValNode<Tag, Left, Right>
impl<Tag, Left, Right> RefUnwindSafe for TagValNode<Tag, Left, Right>
impl<Tag, Left, Right> Send for TagValNode<Tag, Left, Right>
impl<Tag, Left, Right> Sync for TagValNode<Tag, Left, Right>
impl<Tag, Left, Right> Unpin for TagValNode<Tag, Left, Right>
impl<Tag, Left, Right> UnsafeUnpin for TagValNode<Tag, Left, Right>where
Left: UnsafeUnpin,
Right: UnsafeUnpin,
impl<Tag, Left, Right> UnwindSafe for TagValNode<Tag, Left, Right>
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