pub struct Overlay {
pub base_key: BaseKey,
pub base_generation: u64,
pub deltas: HashMap<String, FileDelta>,
}Expand description
Fields§
§base_key: BaseKeyThe base this overlay was derived against (identity half of the fence).
base_generation: u64The base generation this overlay was derived against (fence token).
deltas: HashMap<String, FileDelta>Dirty/uncommitted deltas, keyed by forward-slash relative path.
Implementations§
Source§impl Overlay
impl Overlay
Sourcepub fn upsert(&mut self, rel_path: impl Into<String>, file: Arc<IndexedFile>)
pub fn upsert(&mut self, rel_path: impl Into<String>, file: Arc<IndexedFile>)
Record an upsert delta for rel_path.
Sourcepub fn tombstone(&mut self, rel_path: impl Into<String>)
pub fn tombstone(&mut self, rel_path: impl Into<String>)
Record a tombstone (deletion) delta for rel_path.
Sourcepub fn delta_count(&self) -> usize
pub fn delta_count(&self) -> usize
Number of live deltas (the dirty-set size K).
Sourcepub fn is_valid_against(&self, base: &IndexBase) -> bool
pub fn is_valid_against(&self, base: &IndexBase) -> bool
Validity check against a base (D2): an overlay is valid iff its key and generation both match the base it is read against.
Sourcepub fn rebase(&mut self, new_base: &IndexBase, still_dirty: &HashSet<String>)
pub fn rebase(&mut self, new_base: &IndexBase, still_dirty: &HashSet<String>)
Rebase this overlay onto a NEW base after a commit advance (D2 trigger
(a) / data-model state transition dirty --base commit advances-->).
still_dirty is the recomputed dirty set from uncommitted_paths()
(git.rs:68) — the set of paths that remain uncommitted against the new
base. Deltas whose path is no longer in still_dirty were absorbed by
the new base (committed) and are dropped; the rest are kept and re-fenced
to the new base.
COST: O(K) where K = self.deltas.len(). It iterates only the overlay’s
own deltas and probes the (typically small) still_dirty set. It does
NOT scan the base’s N-file map. This is the spike’s load-bearing claim
(the named CoW perf cliff falsifier).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Overlay
impl RefUnwindSafe for Overlay
impl Send for Overlay
impl Sync for Overlay
impl Unpin for Overlay
impl UnsafeUnpin for Overlay
impl UnwindSafe for Overlay
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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