Skip to main content

LiveEdgeCollector

Struct LiveEdgeCollector 

Source
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

Source

pub fn new(members: &[CellRef]) -> Self

Build a collector for the given SCC membership. Member order defines the indices used in recorded edges.

Source

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]).

Source

pub fn member_count(&self) -> usize

Source

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.

Source

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).

Source

pub fn record_scalar(&self, sheet_id: SheetId, row: u32, col: u32)

Record a scalar read of (sheet_id, row, col) (0-based).

Source

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.

Source

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).

Source

pub fn take_edges(&self) -> FxHashSet<(u32, u32)>

Drain the collected edges, leaving the collector empty (current member attribution is preserved).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.