pub struct PropertyTracker<DirtyHandler = ()> { /* private fields */ }
Expand description

This structure allow to run a closure that queries properties, and can report if any property we accessed have become dirty

Implementations§

Register this property tracker as a dependency to the current binding/property tracker being evaluated

Any of the properties accessed during the last evaluation of the closure called from the last call to evaluate is potentially dirty.

Evaluate the function, and record dependencies of properties accessed within this function. If this is called during the evaluation of another property binding or property tracker, then any changes to accessed properties will also mark the other binding/tracker dirty.

Evaluate the function, and record dependencies of properties accessed within this function. If this is called during the evaluation of another property binding or property tracker, then any changes to accessed properties will not propagate to the other tracker.

Call Self::evaluate if and only if it is dirty. But register a dependency in any case.

Mark this PropertyTracker as dirty

Sets the specified callback handler function, which will be called if any properties that this tracker depends on becomes dirty.

The handmer PropertyDirtyHandler is a trait which is implemented for any Fn() closure

Note that the handler will be invoked immediatly when a property is modified or marked as dirty. In particular, the involved property are still in a locked state and should not be accessed while the handler is run. This function can be usefull to mark some work to be done later.

Trait Implementations§

Returns the “default value” for a type. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.