Struct AnsiCodeIterator
pub struct AnsiCodeIterator<'a> { /* private fields */ }
An iterator over ansi codes in a string.
This type can be used to scan over ansi codes in a string.
It yields tuples in the form (s, is_ansi) where s is a slice of
the original string and is_ansi indicates if the slice contains
ansi codes or string values.
Implementations
impl<'a> AnsiCodeIterator<'a>
fn new(s: &'a str) -> AnsiCodeIterator<'a>Creates a new ansi code iterator.
fn current_slice(&self) -> &strReturns the string slice up to the current match.
fn rest_slice(&self) -> &strReturns the string slice from the current match to the end.
Trait Implementations
impl FusedIterator for AnsiCodeIterator<'_>
impl<'a> Iterator for AnsiCodeIterator<'a>
type Item = (&'a str, bool);fn next(&mut self) -> Option<(&'a str, bool)>