[][src]Struct tree_sitter_highlight::Highlighter

pub struct Highlighter { /* fields omitted */ }

Performs syntax highlighting, recognizing a given list of highlight names.

For the best performance Highlighter values should be reused between syntax highlighting calls. A separate highlighter is needed for each thread that is performing highlighting.

Implementations

impl Highlighter[src]

pub fn new() -> Self[src]

pub fn parser(&mut self) -> &mut Parser[src]

pub fn highlight<'a>(
    &'a mut self,
    config: &'a HighlightConfiguration,
    source: &'a [u8],
    cancellation_flag: Option<&'a AtomicUsize>,
    injection_callback: impl FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a
) -> Result<impl Iterator<Item = Result<HighlightEvent, Error>> + 'a, Error>
[src]

Iterate over the highlighted regions for a given slice of source code.

Auto Trait Implementations

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<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.