pub struct VisibleHighlightsKey {
pub buffer_id: BufferId,
pub snapshot_ptr: usize,
pub syntax_text_version: u64,
pub scroll: u32,
pub viewport_height: u32,
pub fold_hash: u64,
pub inlay_version: u64,
pub static_overlay_version: u64,
}Expand description
Cache key identifying the inputs that produced a particular
StaticOverlayQuads. The overlay worker compares the current
inputs against StaticOverlayQuads::computed_for_key to
short-circuit re-bucketing on a no-op tick (cursor blink,
unchanged scroll/viewport/folds).
snapshot_ptr is the Arc::as_ptr of the snapshot the bucket
was computed against — distinct snapshots produce distinct keys
even if text_version happens to match.
Migrated from crates/lattice-host/src/highlights.rs in X2;
the renderer’s read contract is now the canonical owner.
Perf plan A.2 slice A.2b.2: inlay_version axis — a content
hash of the gated SyntaxRenderState.inlay_hints payload. When
inlays arrive, change, or the mode-gate flips, the hash bumps
and the worker recomposes rows so the inlay splice stays
current. Stable across pure-scroll / cursor-blink ticks (the
hash is recomputed from the same payload).
Fields§
§buffer_id: BufferIdWhich buffer these quads were bucketed for.
Without it the key describes a viewport rather than a DOCUMENT, and the two are not the same thing the moment the active buffer changes. The stale-snapshot hold below re-publishes the previous quads under a new key, which is right mid-edit in one buffer and wrong across a switch — it painted the buffer you left onto the buffer you opened, at the exact offsets it had there. Nothing else in this key could tell the two cases apart.
snapshot_ptr: usize§syntax_text_version: u64§scroll: u32§viewport_height: u32§fold_hash: u64§inlay_version: u64§static_overlay_version: u64Perf plan B.2: content hash of the static-overlay payload
(doc_highlights + all_matches + substitute_matches). Bumps
independently from inlay_version so a search-query change
invalidates the overlay bucket without forcing a row
recompose, and an inlay arrival doesn’t invalidate the
overlay bucket. Built from
static_overlay_state_version at publish time so the
hash and the payload stay aligned by construction.
Trait Implementations§
Source§impl Clone for VisibleHighlightsKey
impl Clone for VisibleHighlightsKey
Source§fn clone(&self) -> VisibleHighlightsKey
fn clone(&self) -> VisibleHighlightsKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VisibleHighlightsKey
Source§impl Debug for VisibleHighlightsKey
impl Debug for VisibleHighlightsKey
Source§impl Default for VisibleHighlightsKey
impl Default for VisibleHighlightsKey
Source§fn default() -> VisibleHighlightsKey
fn default() -> VisibleHighlightsKey
impl Eq for VisibleHighlightsKey
Source§impl PartialEq for VisibleHighlightsKey
impl PartialEq for VisibleHighlightsKey
impl StructuralPartialEq for VisibleHighlightsKey
Auto Trait Implementations§
impl Freeze for VisibleHighlightsKey
impl RefUnwindSafe for VisibleHighlightsKey
impl Send for VisibleHighlightsKey
impl Sync for VisibleHighlightsKey
impl Unpin for VisibleHighlightsKey
impl UnsafeUnpin for VisibleHighlightsKey
impl UnwindSafe for VisibleHighlightsKey
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more