Struct StripPrefixError
pub struct StripPrefixError<I, Prefix: Iterator, T> { pub iterator: I, pub prefix: Prefix, pub mismatch: (Option<T>, Prefix::Item) }
The error returned by Itertools::strip_prefix and
Itertools::strip_prefix_by when the iterator does not start with the
requested prefix.
All fields are public so callers can recover the partially-consumed iterators and the mismatched items.
Fields
iterator: IThe remainder of the original iterator, advanced past the matched prefix items but stopped at the position of the mismatch.
prefix: PrefixThe remainder of the prefix iterator, starting just after the prefix item that failed to match.
mismatch: (Option<T>, Prefix::Item)The pair of items that failed to compare equal. The first element is
Noneifiteratorwas exhausted before the prefix was fully matched.
Trait Implementations
impl<I: Clone, Prefix: Clone + Iterator, T: Clone> Clone for StripPrefixError<I, Prefix, T>
where
Prefix::Item: Clone,
fn clone(&self) -> Self
impl<I: Debug, Prefix: Debug + Iterator, T: Debug> Debug for StripPrefixError<I, Prefix, T>
where
Prefix::Item: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Result