pub struct Property<T>where
T: 'static + Clone,{ /* private fields */ }Expand description
Property represents a storage which may receive new values via it’s slot and may notify about value change via it’s signal.
It’s important that Property::try_update method have to be called to initiate slot data processing.
Implementations§
Source§impl<T> Property<T>where
T: 'static + Clone,
impl<T> Property<T>where
T: 'static + Clone,
Sourcepub fn signal(&mut self) -> &mut Signal<T>
pub fn signal(&mut self) -> &mut Signal<T>
Signal will be emited at least every time inner value will be changed
It’s possible that signal may be emited with the same value.
Sourcepub fn slot(&self) -> &dyn Slot<T>
pub fn slot(&self) -> &dyn Slot<T>
The slot allows value change to be scheduled.
The value will not be changed without (Property::try_update) call. Only after that the value will be update and signal will be emited.
Sourcepub fn set(&mut self, new_value: T)
pub fn set(&mut self, new_value: T)
Sets new value. Signal will be emited to inform about value change.
Sourcepub fn for_mut(&mut self, f: &dyn Fn(&mut T))
pub fn for_mut(&mut self, f: &dyn Fn(&mut T))
Allow function to be change inner value. Signal will be rased to inform about value change even if value is the same.
Sourcepub fn try_update(&mut self) -> bool
pub fn try_update(&mut self) -> bool
Initiates inner value update from slot’s data. Signal will be emited for every incoming slot data.
return true if there was at least one update from slot, otherwise return false