pub struct DiffOverlayVirtualRowProvider { /* private fields */ }Expand description
One provider per active diff session.
Holds an Arc<DiffSession> (RCU reads of
session.current_hunks() are lock-free and stay coherent
even if the registry has dropped the session entry) plus a
shared cache of rendered rows. The cache is populated by
DiffOverlayRefreshTask off the worker thread; collect()
only reads.
Implementations§
Source§impl DiffOverlayVirtualRowProvider
impl DiffOverlayVirtualRowProvider
pub fn new(session: Arc<DiffSession>) -> Self
pub fn session(&self) -> &Arc<DiffSession> ⓘ
Sourcepub fn render_rows(
session: &DiffSession,
baseline: &dyn DiffParticipantSource,
syntax: Option<&SyntaxContext>,
) -> (u64, Vec<VirtualRow>)
pub fn render_rows( session: &DiffSession, baseline: &dyn DiffParticipantSource, syntax: Option<&SyntaxContext>, ) -> (u64, Vec<VirtualRow>)
D.3.b (2026-05-29): pure sync render — walk the session’s
current HunkIndex, snapshot the baseline rope, render
each baseline-deleted line into a Vec<Cell>, return
the resulting Vec<VirtualRow> plus the revision they
were rendered against. Public so tests can exercise the
render path without spinning up the async refresh task.
D.3.b.2 (2026-05-29): syntax provides a Lang,
LangRegistry, and Theme for one-shot tree-sitter
highlighting of the baseline rope. When None, cells
emit with fg = 0 and the renderer falls back to
monochrome — backward-compatible with D.3.b’s behavior.
Source§impl DiffOverlayVirtualRowProvider
impl DiffOverlayVirtualRowProvider
Sourcepub fn cache_handle(&self) -> Arc<Mutex<DiffOverlayCache>> ⓘ
pub fn cache_handle(&self) -> Arc<Mutex<DiffOverlayCache>> ⓘ
D.3.b: expose the shared cache so DiffOverlayRefreshTask::spawn
can be wired to write to the same Mutex the provider’s
collect/version read from.
Trait Implementations§
Source§impl VirtualRowProvider for DiffOverlayVirtualRowProvider
impl VirtualRowProvider for DiffOverlayVirtualRowProvider
Source§fn id(&self) -> ProviderId
fn id(&self) -> ProviderId
Source§fn version(&self) -> u64
fn version(&self) -> u64
Self::collect] would emit have
changed. The worker uses the combined fingerprint of all
providers’ versions to short-circuit on the cache-hit
path without paying for the (potentially expensive)
collect calls. Read moreAuto Trait Implementations§
impl Freeze for DiffOverlayVirtualRowProvider
impl RefUnwindSafe for DiffOverlayVirtualRowProvider
impl Send for DiffOverlayVirtualRowProvider
impl Sync for DiffOverlayVirtualRowProvider
impl Unpin for DiffOverlayVirtualRowProvider
impl UnsafeUnpin for DiffOverlayVirtualRowProvider
impl UnwindSafe for DiffOverlayVirtualRowProvider
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<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