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]

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]

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]

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 Default for PropertyTracker<()>[src]

impl<ChangeHandler> Drop for PropertyTracker<ChangeHandler>[src]

Auto Trait Implementations

impl<ChangeHandler = ()> !RefUnwindSafe for PropertyTracker<ChangeHandler>

impl<ChangeHandler = ()> !Send for PropertyTracker<ChangeHandler>

impl<ChangeHandler = ()> !Sync for PropertyTracker<ChangeHandler>

impl<ChangeHandler = ()> !Unpin for PropertyTracker<ChangeHandler>

impl<ChangeHandler = ()> !UnwindSafe for PropertyTracker<ChangeHandler>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.