Struct tree_sitter_highlight::Highlighter [−][src]
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]
&'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>
Iterate over the highlighted regions for a given slice of source code.
Auto Trait Implementations
impl RefUnwindSafe for Highlighter
impl Send for Highlighter
impl !Sync for Highlighter
impl Unpin for Highlighter
impl UnwindSafe for Highlighter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,