pub enum PropValue {
Value(BoxedValue),
Dynamic(Rc<dyn Fn() -> BoxedValue>),
TwoWay {
get: Rc<dyn Fn() -> BoxedValue>,
set: Rc<dyn Fn(&dyn Any)>,
},
Element(Rc<RefCell<Option<Element>>>),
Binding(Rc<dyn BindingBase>),
}Expand description
The value an element gives a property.
Variants§
Value(BoxedValue)
A value, set once. Values compare by value.
Dynamic(Rc<dyn Fn() -> BoxedValue>)
A value computed by a reactive closure: the property is set again whenever what the closure read changes.
TwoWay
A value that goes both ways: the property follows get, and a change
of the property is given to set.
Fields
§
get: Rc<dyn Fn() -> BoxedValue>The value of the source, read reactively.
Element(Rc<RefCell<Option<Element>>>)
An element, mounted with its parent: the property holds its control
(Content, Tag, a header).
Binding(Rc<dyn BindingBase>)
A binding of the property system (Binding, a path on the data
context, a compiled binding).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PropValue
impl !Send for PropValue
impl !Sync for PropValue
impl !UnwindSafe for PropValue
impl Freeze for PropValue
impl Unpin for PropValue
impl UnsafeUnpin for PropValue
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> AnyValueEq for Twhere
T: PartialEq + 'static,
impl<T> AnyValueEq for Twhere
T: PartialEq + 'static,
Source§fn item_equals(&self, other: &(dyn AnyValueEq + 'static)) -> bool
fn item_equals(&self, other: &(dyn AnyValueEq + 'static)) -> bool
Whether
other holds an equal value.Source§fn item_as_any(&self) -> &(dyn Any + 'static)
fn item_as_any(&self) -> &(dyn Any + 'static)
The value as
Any.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromValue<Option<T>> for Twhere
T: Clone,
impl<T> FromValue<Option<T>> for Twhere
T: Clone,
Source§fn from_value(value: &Option<T>) -> Option<T>
fn from_value(value: &Option<T>) -> Option<T>
The value of the signal, or
None when the value of the property has
none (the signal keeps its value).Source§impl<T> FromValue<T> for Twhere
T: Clone,
impl<T> FromValue<T> for Twhere
T: Clone,
Source§fn from_value(value: &T) -> Option<T>
fn from_value(value: &T) -> Option<T>
The value of the signal, or
None when the value of the property has
none (the signal keeps its value).Source§impl<T> IntoValue<Option<T>> for Twhere
T: PropertyValue,
impl<T> IntoValue<Option<T>> for Twhere
T: PropertyValue,
Source§fn into_value(self) -> Option<T>
fn into_value(self) -> Option<T>
The value of the property.