[−][src]Struct syntect::highlighting::Highlighter
Basically a wrapper around a Theme
preparing it to be used for highlighting.
This is part of the API to preserve the possibility of caching
matches of the selectors of the theme on various scope paths
or setting up some kind of accelerator structure.
So for now this does very little but eventually if you keep it around between highlighting runs it will preserve its cache.
Implementations
impl<'a> Highlighter<'a>
[src]
pub fn new(theme: &'a Theme) -> Highlighter<'a>
[src]
pub fn get_default(&self) -> Style
[src]
The default style in the absence of any matched rules. Basically what plain text gets highlighted as.
pub fn style_for_stack(&self, stack: &[Scope]) -> Style
[src]
Returns the fully resolved style for the given stack.
This operation is convenient but expensive. For reasonable performance, the caller should be caching results.
pub fn style_mod_for_stack(&self, path: &[Scope]) -> StyleModifier
[src]
Returns a StyleModifier
which, if applied to the default style,
would generate the fully resolved style for this stack.
This is made available to applications that are using syntect styles in combination with style information from other sources.
This operation is convenient but expensive. For reasonable performance, the caller should be caching results. It's likely slower than style_for_stack.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Highlighter<'a>
impl<'a> Send for Highlighter<'a>
impl<'a> Sync for Highlighter<'a>
impl<'a> Unpin for Highlighter<'a>
impl<'a> UnwindSafe for Highlighter<'a>
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,
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.
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>,