[][src]Struct syntect::highlighting::RangedHighlightIterator

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

Highlights a line of parsed code given a HighlightState and line of changes from the parser.

Yields the Style, the text and well as the Range of the text in the source string.

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

Implementations

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

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

Notable traits for RangedHighlightIterator<'a, 'b>

impl<'a, 'b> Iterator for RangedHighlightIterator<'a, 'b> type Item = (Style, &'b str, Range<usize>);
[src]

Trait Implementations

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

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

type Item = (Style, &'b str, Range<usize>)

The type of the elements being iterated over.

pub fn next(&mut self) -> Option<(Style, &'b str, Range<usize>)>[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 RangedHighlightIterator<'a, 'b>

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

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

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

impl<'a, 'b> !UnwindSafe for RangedHighlightIterator<'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.