pub fn track_new<T>(name: &str, value: T) -> TExpand description
Track a new variable creation.
Records a New event and returns the value unchanged. Use this when
a variable is first created or initialized.
§Arguments
name- A descriptive name for the variable (used in event output)value- The value being tracked (returned unchanged)
§Returns
The input value, unchanged. This allows chaining:
let x = track_new("x", 42);
assert_eq!(x, 42);§Examples
Basic usage:
let data = track_new("data", vec![1, 2, 3]);
let events = get_events();
assert!(events[0].is_new());With structs:
struct Point { x: i32, y: i32 }
let p = track_new("point", Point { x: 10, y: 20 });