pub struct HighlightEngine { /* private fields */ }Expand description
A cheap-to-clone, Send + Sync handle to a grammar + theme for off-thread
bulk tokenization. Nothing syntect crosses its surface; SegmentBoundary
and SegmentTokens are opaque. Obtain via HighlightCache::engine (to
share the cache’s exact grammar/theme) or HighlightEngine::new, and move
clones to worker threads.
Implementations§
Source§impl HighlightEngine
impl HighlightEngine
Sourcepub fn new(syntax: SyntaxDef, theme: TokenTheme) -> Self
pub fn new(syntax: SyntaxDef, theme: TokenTheme) -> Self
An engine over an injected grammar + theme (mirrors Highlighter::new).
Sourcepub fn fresh_boundary(&self) -> SegmentBoundary
pub fn fresh_boundary(&self) -> SegmentBoundary
The document-top fresh start state, as a boundary. The coordinator
compares a segment’s guessed Fresh start against a prior segment’s
true end with this: equal => the guess was right, the segment verifies
as-is; unequal => re-run from the true end.
Trait Implementations§
Source§impl Clone for HighlightEngine
impl Clone for HighlightEngine
Source§fn clone(&self) -> HighlightEngine
fn clone(&self) -> HighlightEngine
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HighlightEngine
impl RefUnwindSafe for HighlightEngine
impl Send for HighlightEngine
impl Sync for HighlightEngine
impl Unpin for HighlightEngine
impl UnsafeUnpin for HighlightEngine
impl UnwindSafe for HighlightEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more