Skip to main content

ModelTracker

Trait ModelTracker 

Source
pub trait ModelTracker {
    // Required methods
    fn attach_peer(&self, peer: ModelPeer<'_>);
    fn track_row_count_changes(&self);
    fn track_row_data_changes(&self, row: usize);
}
Expand description

This trait defines the interface that users of a model can use to track changes to a model. It is supplied via Model::model_tracker and implementation usually return a reference to its field of ModelNotify.

Required Methods§

Source

fn attach_peer(&self, peer: ModelPeer<'_>)

Attach one peer. The peer will be notified when the model changes

Source

fn track_row_count_changes(&self)

Register the model as a dependency to the current binding being evaluated, so that it will be notified when the model changes its size.

Source

fn track_row_data_changes(&self, row: usize)

Register a row as a dependency to the current binding being evaluated, so that it will be notified when the value of that row changes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ModelTracker for ()

Implementors§