pub struct Highlighter { /* private fields */ }Expand description
A running background highlighter.
Submits highlight and context work to the worker thread spawned by
spawn_highlighter. Dropping the handle disconnects the command channel,
which stops the worker once it drains.
Implementations§
Source§impl Highlighter
impl Highlighter
Sourcepub fn highlight(
&self,
requests: Vec<HighlightRequest>,
) -> Option<Vec<HighlightRequest>>
pub fn highlight( &self, requests: Vec<HighlightRequest>, ) -> Option<Vec<HighlightRequest>>
Queues a batch of rows for highlighting.
Returns the requests back when the worker queue is full or gone, so the
caller can cancel them with
DiffViewer::cancel_highlights.
Returns None once the batch is queued.
Sourcepub fn context(&self, request: ContextRequest) -> bool
pub fn context(&self, request: ContextRequest) -> bool
Queues a context refetch, returning whether it was accepted.
Auto Trait Implementations§
impl Freeze for Highlighter
impl RefUnwindSafe for Highlighter
impl Send for Highlighter
impl Sync for Highlighter
impl Unpin for Highlighter
impl UnsafeUnpin for Highlighter
impl UnwindSafe for Highlighter
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