Struct sixtyfps_corelib::properties::PropertyTracker [−][src]
pub struct PropertyTracker<ChangeHandler = ()> { /* fields omitted */ }
This structure allow to run a closure that queries properties, and can report if any property we accessed have become dirty
Implementations
impl<ChangeHandler: PropertyChangeHandler> PropertyTracker<ChangeHandler>
[src]
impl<ChangeHandler: PropertyChangeHandler> PropertyTracker<ChangeHandler>
[src]pub fn is_dirty(&self) -> bool
[src]
Any of the properties accessed during the last evaluation of the closure called from the last call to evaluate is pottentially dirty.
pub fn evaluate<R>(self: Pin<&Self>, f: impl FnOnce() -> R) -> R
[src]
Evaluate the function, and record dependencies of properties accessed whithin 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.
pub fn evaluate_as_dependency_root<R>(
self: Pin<&Self>,
f: impl FnOnce() -> R
) -> R
[src]
self: Pin<&Self>,
f: impl FnOnce() -> R
) -> R
Evaluate the function, and record dependencies of properties accessed whithin 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.
pub fn evaluate_if_dirty<R>(
self: Pin<&Self>,
f: impl FnOnce() -> R
) -> Option<R>
[src]
self: Pin<&Self>,
f: impl FnOnce() -> R
) -> Option<R>
Call Self::evaluate
if and only if it is dirty.
But register a dependency in any case.
pub fn set_dirty(&self)
[src]
Mark this PropertyTracker as dirty
pub fn new_with_change_handler(handler: ChangeHandler) -> Self
[src]
Sets the specified callback handler function, which will be called if any properties that this tracker depends on change their value.
Trait Implementations
impl<ChangeHandler> Drop for PropertyTracker<ChangeHandler>
[src]
impl<ChangeHandler> Drop for PropertyTracker<ChangeHandler>
[src]Auto Trait Implementations
impl<ChangeHandler = ()> !RefUnwindSafe for PropertyTracker<ChangeHandler>
impl<ChangeHandler = ()> !RefUnwindSafe for PropertyTracker<ChangeHandler>
impl<ChangeHandler = ()> !Send for PropertyTracker<ChangeHandler>
impl<ChangeHandler = ()> !Send for PropertyTracker<ChangeHandler>
impl<ChangeHandler = ()> !Sync for PropertyTracker<ChangeHandler>
impl<ChangeHandler = ()> !Sync for PropertyTracker<ChangeHandler>
impl<ChangeHandler = ()> !Unpin for PropertyTracker<ChangeHandler>
impl<ChangeHandler = ()> !Unpin for PropertyTracker<ChangeHandler>
impl<ChangeHandler = ()> !UnwindSafe for PropertyTracker<ChangeHandler>
impl<ChangeHandler = ()> !UnwindSafe for PropertyTracker<ChangeHandler>