pub(crate) struct ParsedItem<'a, T>(pub(crate) &'a [u8], pub(crate) T);
Expand description
An item that has been parsed. Represented as a (remaining, value)
pair.
Tuple Fields§
§0: &'a [u8]
§1: T
Implementations§
source§impl<'a, T> ParsedItem<'a, T>
impl<'a, T> ParsedItem<'a, T>
sourcepub(crate) fn map<U>(self, f: impl FnOnce(T) -> U) -> ParsedItem<'a, U>
pub(crate) fn map<U>(self, f: impl FnOnce(T) -> U) -> ParsedItem<'a, U>
Map the value to a new value, preserving the remaining input.
sourcepub(crate) fn flat_map<U>(
self,
f: impl FnOnce(T) -> Option<U>,
) -> Option<ParsedItem<'a, U>>
pub(crate) fn flat_map<U>( self, f: impl FnOnce(T) -> Option<U>, ) -> Option<ParsedItem<'a, U>>
Map the value to a new, optional value, preserving the remaining input.
source§impl<'a> ParsedItem<'a, ()>
impl<'a> ParsedItem<'a, ()>
sourcepub(crate) const fn into_inner(self) -> &'a [u8] ⓘ
pub(crate) const fn into_inner(self) -> &'a [u8] ⓘ
Discard the unit value, returning the remaining input.
source§impl<'a> ParsedItem<'a, Option<()>>
impl<'a> ParsedItem<'a, Option<()>>
sourcepub(crate) const fn into_inner(self) -> &'a [u8] ⓘ
pub(crate) const fn into_inner(self) -> &'a [u8] ⓘ
Discard the potential unit value, returning the remaining input.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for ParsedItem<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for ParsedItem<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ParsedItem<'a, T>where
T: Send,
impl<'a, T> Sync for ParsedItem<'a, T>where
T: Sync,
impl<'a, T> Unpin for ParsedItem<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for ParsedItem<'a, T>where
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