track_cell_set

Function track_cell_set 

Source
pub fn track_cell_set(cell_id: &str, location: &str)
Expand description

Track Cell::set operation.

Records a CellSet event. Use this when writing a value to a Cell.

§Arguments

  • cell_id - Identifier of the Cell being written
  • location - Source location (e.g., “file.rs:42”)

§Examples

use std::cell::Cell;

let counter = track_cell_new("counter", Cell::new(0));
counter.set(1);
track_cell_set("counter", "main.rs:5");
counter.set(2);
track_cell_set("counter", "main.rs:6");

let events = get_events();
assert_eq!(events.iter().filter(|e| matches!(e, borrowscope_runtime::Event::CellSet { .. })).count(), 2);