pub struct LiveEdgeCollector { /* private fields */ }Expand description
Records which reads actually occurred targeting SCC members during a sequential member-by-member evaluation pass.
- Scalar reads are O(1) (hash lookup keyed by
(sheet, row, col)). - Rectangle reads are recorded once per resolved rect and intersected with the membership in O(|SCC|) — never per cell of the rect.
- Name reads (named-formula SCC members, spec §7.13) are O(1) lookups by the engine-folded name key.
Member indices are split: cell members occupy 0..cell_count, name
members occupy cell_count..cell_count + name_count (matching the spec
§7.13 member ordering used by SCC tasks: cells first, then names).
Implementations§
Source§impl LiveEdgeCollector
impl LiveEdgeCollector
Sourcepub fn new(members: &[CellRef]) -> Self
pub fn new(members: &[CellRef]) -> Self
Build a collector for the given SCC membership. Member order defines the indices used in recorded edges.
Sourcepub fn new_with_names(cells: &[CellRef], names: &[String]) -> Self
pub fn new_with_names(cells: &[CellRef], names: &[String]) -> Self
Build a collector over cell members plus name-vertex members. Cell
members get indices 0..cells.len(); name member j gets index
cells.len() + j. names must already be folded with the engine’s
name-folding rule (see [Engine::fold_name_key]).
pub fn member_count(&self) -> usize
Sourcepub fn set_current(&self, member_idx: u32)
pub fn set_current(&self, member_idx: u32)
Set the member whose formula is about to be evaluated; subsequent recorded reads are attributed to it.
Sourcepub fn clear_current(&self)
pub fn clear_current(&self)
Stop attributing reads to any member (used between passes so that out-of-band reads — snapshots, deltas — never record edges).
Sourcepub fn record_scalar(&self, sheet_id: SheetId, row: u32, col: u32)
pub fn record_scalar(&self, sheet_id: SheetId, row: u32, col: u32)
Record a scalar read of (sheet_id, row, col) (0-based).
Sourcepub fn record_rect(&self, sheet_id: SheetId, sr: u32, sc: u32, er: u32, ec: u32)
pub fn record_rect(&self, sheet_id: SheetId, sr: u32, sc: u32, er: u32, ec: u32)
Record a rectangle read (0-based, inclusive corners). Intersection is O(|SCC|): each member is tested against the rect once; the rect is never enumerated per cell.
Sourcepub fn record_name(&self, folded_name: &str)
pub fn record_name(&self, folded_name: &str)
Record a read of a named entity by folded name key (e.g. a formula referencing a named-formula SCC member).
Sourcepub fn take_edges(&self) -> FxHashSet<(u32, u32)>
pub fn take_edges(&self) -> FxHashSet<(u32, u32)>
Drain the collected edges, leaving the collector empty (current member attribution is preserved).
Auto Trait Implementations§
impl !Freeze for LiveEdgeCollector
impl RefUnwindSafe for LiveEdgeCollector
impl Send for LiveEdgeCollector
impl Sync for LiveEdgeCollector
impl Unpin for LiveEdgeCollector
impl UnsafeUnpin for LiveEdgeCollector
impl UnwindSafe for LiveEdgeCollector
Blanket Implementations§
impl<T> Allocation for T
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> 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