#[non_exhaustive]pub enum ParseKind {
Viewport,
Top,
Bottom,
}Expand description
Discriminates the purpose of a parse request / result so the App can route it to the correct per-slot cache field.
Viewport— the current visible region (already existed; default).Top— rows0..min(3*h, line_count)pre-cached soggnever flashes un-highlighted rows.Bottom— rowsline_count - min(3*h, line_count)..line_countpre-cached soGnever flashes un-highlighted rows.
Ordering is load-bearing for the perf invariant: the worker queue
is FIFO, so submitting Viewport first, then Top, then Bottom
ensures the retained tree is built on the Viewport pass and the
subsequent passes ride it incrementally (~1-5 ms each).
§Examples
use hjkl_syntax::ParseKind;
assert_ne!(ParseKind::Viewport, ParseKind::Top);
assert_ne!(ParseKind::Top, ParseKind::Bottom);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Viewport
The current visible viewport region.
Top
The top of the document (rows 0..N) — pre-cached for gg.
Bottom
The bottom of the document (rows line_count-N..line_count) — pre-cached for G.
Trait Implementations§
impl Copy for ParseKind
impl Eq for ParseKind
impl StructuralPartialEq for ParseKind
Auto Trait Implementations§
impl Freeze for ParseKind
impl RefUnwindSafe for ParseKind
impl Send for ParseKind
impl Sync for ParseKind
impl Unpin for ParseKind
impl UnsafeUnpin for ParseKind
impl UnwindSafe for ParseKind
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