Skip to main content

ChangeTracker

Trait ChangeTracker 

Source
pub trait ChangeTracker {
    // Required method
    fn get_changes(&self, prev: &Self) -> Vec<(&'static str, Value)>;

    // Provided methods
    fn unpack_bits(&mut self) { ... }
    fn pack_bits(&mut self) { ... }
}
Expand description

Trait for detecting changes in memory structures.

Required Methods§

Source

fn get_changes(&self, prev: &Self) -> Vec<(&'static str, Value)>

Compare self with a previous state and return a list of changed fields. Returns a vector of (field_name, new_value).

Provided Methods§

Source

fn unpack_bits(&mut self)

Unpack bit-mapped variables from their source words. Called automatically after reading shared memory, before process_tick. Auto-generated by codegen when bit-mapped variables exist; default is no-op.

Source

fn pack_bits(&mut self)

Pack bit-mapped variables back into their source words. Called automatically after process_tick, before writing shared memory. Auto-generated by codegen when bit-mapped variables exist; default is no-op.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§