Skip to main content

FieldDiff

Trait FieldDiff 

Source
pub trait FieldDiff: Hash {
    type Path: Copy + Eq + Hash + Send + Sync + 'static;

    // Required method
    fn field_hashes(&self, out: &mut Vec<(Self::Path, u64)>);
}
Expand description

State types implement this so subscribers can detect which fields changed by comparing per-field hashes — never by cloning the whole value.

Required Associated Types§

Source

type Path: Copy + Eq + Hash + Send + Sync + 'static

Stable identifier for a top-level (or nested) field path.

Required Methods§

Source

fn field_hashes(&self, out: &mut Vec<(Self::Path, u64)>)

Push (path, field_hash) for each tracked field.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§