pub struct VersionTracker { /* private fields */ }Expand description
Token-version tracker for json paths
Implementations§
Source§impl VersionTracker
impl VersionTracker
pub fn new() -> Self
pub fn get(&self, path: &str) -> u64
pub fn bump(&mut self, path: &str)
Sourcepub fn merge_from(&mut self, other: &VersionTracker)
pub fn merge_from(&mut self, other: &VersionTracker)
Merge version counters from other, taking the maximum for each path.
Using max (not insert) ensures that if this tracker already saw a higher version
for a path (e.g., from a previous subform evaluation round), it is never downgraded.
Sourcepub fn merge_from_params(&mut self, other: &VersionTracker)
pub fn merge_from_params(&mut self, other: &VersionTracker)
Merge only /$params-prefixed version counters from other (max strategy).
Used when giving a per-item tracker the latest schema-level param versions
without absorbing data-path bumps that belong to other items.
Sourcepub fn any_bumped_with_prefix(&self, prefix: &str) -> bool
pub fn any_bumped_with_prefix(&self, prefix: &str) -> bool
Returns true if any tracked path with the given prefix has been bumped (version > 0). Used to gate table re-evaluation when item fields change without the item being new.
Sourcepub fn any_newly_bumped_with_prefix(
&self,
prefix: &str,
baseline: &VersionTracker,
) -> bool
pub fn any_newly_bumped_with_prefix( &self, prefix: &str, baseline: &VersionTracker, ) -> bool
Returns true if any path with the given prefix has a higher version than in baseline.
Unlike any_bumped_with_prefix, this detects only brand-new bumps from a specific diff
pass, ignoring historical bumps that were already present in the baseline.
Trait Implementations§
Source§impl Clone for VersionTracker
impl Clone for VersionTracker
Source§fn clone(&self) -> VersionTracker
fn clone(&self) -> VersionTracker
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more