ReversiblePropertyChange
struct · ferroui-xaml-interactivity · v0.5.0
struct ReversiblePropertyChange<TTarget, TValue>
Coordinates reversible, typed property changes across action instances.
TTarget is the handle of the target (Ref<Button>, Rc<ViewModel>), TValue the type of
the value of the property.
Members
new
fn new(property_name: &str) -> Self
Initializes a new reversible property-change coordinator for the property property_name.
Panics
Panics if the name is empty.
apply
fn apply(self: &Self, target: &TTarget, value: TValue, getter: impl Fn(&TTarget) -> TValue + 'static, setter: impl Fn(&TTarget, TValue) -> () + 'static) -> bool
Applies a value while preserving the state required to revert it. getter gets the current
property value, setter sets it. Returns true when the reversible value was applied.
revert
fn revert(self: &Self, _setter: impl Fn(&TTarget, TValue) -> ()) -> bool
Reverts the value previously applied by this coordinator. Returns true when an applied value was reverted.
property_name
fn property_name(self: &Self) -> &str
The name of the property.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.