pub struct Tail;Expand description
Combinator that returns the rest of the input bytes from the current position.
Trait Implementations§
Source§impl<'x, I: VestInput + 'x, O: VestOutput<I>> Combinator<'x, I, O> for Tail
impl<'x, I: VestInput + 'x, O: VestOutput<I>> Combinator<'x, I, O> for Tail
Source§type SType = &'x I
type SType = &'x I
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§fn length(&self, v: Self::SType) -> usize
fn length(&self, v: Self::SType) -> usize
The length of the output buffer.
This can be used to optimize serialization by pre-allocating the buffer.
Source§fn parse(&self, s: I) -> Result<(usize, Self::Type), ParseError>
fn parse(&self, s: I) -> Result<(usize, Self::Type), ParseError>
The parsing function.
To enable “zero-copy” parsing, implementations of
parse should not
consume/deepcopy the input buffer I, but rather return a slice of the
input buffer for Self::Type whenever possible.
See crate::buf_traits::VestInput and crate::buf_traits::VestPublicInput for
more details. Read moreSource§fn serialize(
&self,
v: Self::SType,
data: &mut O,
pos: usize,
) -> Result<usize, SerializeError>
fn serialize( &self, v: Self::SType, data: &mut O, pos: usize, ) -> Result<usize, SerializeError>
The serialization function.
The intended use of
serialize is to serialize a value v into the
buffer buf at the position pos “in-place” (i.e., without
allocating a new buffer or extending the buffer). Read moreimpl SecureSpecCombinator for Tail
Auto Trait Implementations§
impl Freeze for Tail
impl RefUnwindSafe for Tail
impl Send for Tail
impl Sync for Tail
impl Unpin for Tail
impl UnsafeUnpin for Tail
impl UnwindSafe for Tail
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,
Source§impl<T> From<T> for T
impl<T> From<T> for T
Source§fn ex_from(t: T) -> T
fn ex_from(t: T) -> T
Vest equivalent of
std::convert::From::from.Source§impl<T, U> Into<U> for T
impl<T, U> Into<U> for T
Source§fn ex_into(self) -> U
fn ex_into(self) -> U
Vest equivalent of
std::convert::Into::into.Source§impl<T, U> SpecTryInto<U> for Twhere
U: SpecTryFrom<T>,
impl<T, U> SpecTryInto<U> for Twhere
U: SpecTryFrom<T>,
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.