pub struct DirtyTracker { /* private fields */ }Expand description
Tracks field modifications during handler execution with granular change information.
This replaces the simple HashSet
Implementations§
Source§impl DirtyTracker
impl DirtyTracker
Sourcepub fn mark_replaced(&mut self, path: &str)
pub fn mark_replaced(&mut self, path: &str)
Mark a field as replaced (full value will be emitted)
Sourcepub fn mark_appended(&mut self, path: &str, value: Value)
pub fn mark_appended(&mut self, path: &str, value: Value)
Record an appended value for a field
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &FieldChange)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &FieldChange)>
Iterate over all changes
Sourcepub fn dirty_paths(&self) -> HashSet<String>
pub fn dirty_paths(&self) -> HashSet<String>
Get a set of all dirty field paths (for backward compatibility)
Sourcepub fn into_changes(self) -> HashMap<String, FieldChange>
pub fn into_changes(self) -> HashMap<String, FieldChange>
Consume the tracker and return the changes map
Sourcepub fn changes(&self) -> &HashMap<String, FieldChange>
pub fn changes(&self) -> &HashMap<String, FieldChange>
Get a reference to the changes map
Sourcepub fn appended_paths(&self) -> Vec<String>
pub fn appended_paths(&self) -> Vec<String>
Get paths that were appended (not replaced)
Trait Implementations§
Source§impl Clone for DirtyTracker
impl Clone for DirtyTracker
Source§fn clone(&self) -> DirtyTracker
fn clone(&self) -> DirtyTracker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DirtyTracker
impl Debug for DirtyTracker
Source§impl Default for DirtyTracker
impl Default for DirtyTracker
Source§fn default() -> DirtyTracker
fn default() -> DirtyTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DirtyTracker
impl RefUnwindSafe for DirtyTracker
impl Send for DirtyTracker
impl Sync for DirtyTracker
impl Unpin for DirtyTracker
impl UnwindSafe for DirtyTracker
Blanket Implementations§
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
Mutably borrows from an owned value. Read more