[][src]Struct console::AnsiCodeIterator

pub struct AnsiCodeIterator<'a> { /* fields omitted */ }

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>[src]

pub fn new(s: &'a str) -> AnsiCodeIterator<'a>

Notable traits for AnsiCodeIterator<'a>

impl<'a> Iterator for AnsiCodeIterator<'a> type Item = (&'a str, bool);
[src]

Creates a new ansi code iterator.

pub fn current_slice(&self) -> &str[src]

Returns the string slice up to the current match.

pub fn rest_slice(&self) -> &str[src]

Returns the string slice from the current match to the end.

Trait Implementations

impl<'a> Iterator for AnsiCodeIterator<'a>[src]

type Item = (&'a str, bool)

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for AnsiCodeIterator<'a>

impl<'a> Send for AnsiCodeIterator<'a>

impl<'a> !Sync for AnsiCodeIterator<'a>

impl<'a> Unpin for AnsiCodeIterator<'a>

impl<'a> !UnwindSafe for AnsiCodeIterator<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.