pub struct Until<'a, T, V> { /* private fields */ }Expand description
A Peekable that peeks until the given element is found in the
Scanner.
This Peekable will temporarily advance the position of the Scanner to
find a match. If a match is found, the Scanner is rewound to the original
position and a PeekResult is returned. If no match is found, the Scanner
is rewound to the original position and an Err is returned.
Implementations§
Trait Implementations§
Source§impl<'a, T, V> Peekable<'a, T, V, V> for Until<'a, T, V>where
V: RecognizeSelf<'a, T, V> + Clone,
impl<'a, T, V> Peekable<'a, T, V, V> for Until<'a, T, V>where
V: RecognizeSelf<'a, T, V> + Clone,
Source§fn peek(&self, data: &Scanner<'a, T>) -> ParseResult<PeekResult<V, V>>
fn peek(&self, data: &Scanner<'a, T>) -> ParseResult<PeekResult<V, V>>
Peek until the given element is found in the Scanner.
This function will temporarily advance the position of the Scanner to
find a match. If a match is found, the Scanner is rewound to the
original position and a PeekResult is returned. If no match is found,
the Scanner is rewound to the original position and an Err is
returned.
§Arguments
data- TheScannerto use when matching.
§Returns
A PeekResult if the element matches the current position of the
Scanner, or an Err otherwise.