pub struct TLVal<Tag, Len, Body>(pub Body, pub PhantomData<(Tag, Len)>);Expand description
One of the dependent family of combinators
Typically used as Implicit((U8, U16Le), TLVOf(body)).
Tuple Fields§
§0: Body§1: PhantomData<(Tag, Len)>Trait Implementations§
Source§impl<Tag, Len, V> DepCombinator for TLVal<Tag, Len, V>
impl<Tag, Len, V> DepCombinator for TLVal<Tag, Len, V>
Source§open spec fn apply(&self, key: Self::Key) -> Self::Body
open spec fn apply(&self, key: Self::Key) -> Self::Body
{
let (tag, len) = key;
ExactLen(len, self.0.apply(tag))
}Source§open spec fn recover(&self, value: Self::Val) -> Self::Key
open spec fn recover(&self, value: Self::Val) -> Self::Key
{
let tag = self.0.recover(value);
let body = self.0.apply(tag);
(tag, Len::as_self(body.byte_len(value)))
}Source§open spec fn recover_inv(&self) -> bool
open spec fn recover_inv(&self) -> bool
{ self.0.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, Len)
type Key = (Tag, Len)
The type of keys parsed by the head combinator/to be recovered during serialization.
Source§type Val = <V as DepCombinator>::Val
type Val = <V as DepCombinator>::Val
The type of values consumed/produced by the body combinator.
Auto Trait Implementations§
impl<Tag, Len, Body> Freeze for TLVal<Tag, Len, Body>where
Body: Freeze,
impl<Tag, Len, Body> RefUnwindSafe for TLVal<Tag, Len, Body>
impl<Tag, Len, Body> Send for TLVal<Tag, Len, Body>
impl<Tag, Len, Body> Sync for TLVal<Tag, Len, Body>
impl<Tag, Len, Body> Unpin for TLVal<Tag, Len, Body>
impl<Tag, Len, Body> UnsafeUnpin for TLVal<Tag, Len, Body>where
Body: UnsafeUnpin,
impl<Tag, Len, Body> UnwindSafe for TLVal<Tag, Len, Body>
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