[][src]Struct syntect::highlighting::HighlightIterator

pub struct HighlightIterator<'a, 'b> { /* fields omitted */ }

Highlights a line of parsed code given a HighlightState and line of changes from the parser. This is a backwards compatible shim on top of the RangedHighlightIterator which only yields the Style and the Text of the token, not the range.

It splits a line of text into different pieces each with a Style

Implementations

impl<'a, 'b> HighlightIterator<'a, 'b>[src]

pub fn new(
    state: &'a mut HighlightState,
    changes: &'a [(usize, ScopeStackOp)],
    text: &'b str,
    highlighter: &'a Highlighter
) -> HighlightIterator<'a, 'b>
[src]

Trait Implementations

impl<'a, 'b> Debug for HighlightIterator<'a, 'b>[src]

impl<'a, 'b> Iterator for HighlightIterator<'a, 'b>[src]

type Item = (Style, &'b str)

The type of the elements being iterated over.

fn next(&mut self) -> Option<(Style, &'b str)>[src]

Yields the next token of text and the associated Style to render that text with. the concatenation of the strings in each token will make the original string.

Auto Trait Implementations

impl<'a, 'b> RefUnwindSafe for HighlightIterator<'a, 'b>

impl<'a, 'b> Send for HighlightIterator<'a, 'b>

impl<'a, 'b> Sync for HighlightIterator<'a, 'b>

impl<'a, 'b> Unpin for HighlightIterator<'a, 'b>

impl<'a, 'b> !UnwindSafe for HighlightIterator<'a, 'b>

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.