Struct syntect::highlighting::Highlighter[][src]

pub struct Highlighter<'a> { /* fields omitted */ }
Expand description

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

The default style in the absence of any matched rules. Basically what plain text gets highlighted as.

Returns the fully resolved style for the given stack.

This operation is convenient but expensive. For reasonable performance, the caller should be caching results.

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.