Enum PropValue Copy item path Source pub enum PropValue {
Null,
Bool(bool ),
F64(f64 ),
I64(i64 ),
U64(u64 ),
Str(String ),
Array(Vec <PropValue >),
Object(PropMap ),
}Expand description A typed prop value. Covers all value types the widget system uses.
Mirrors JSON’s type system but without serde allocation overhead.
Primitive values are stored inline (no boxing).
§ Wire-canonical equality across numeric variants
JSON does not distinguish integer from float; the wire collapses
42 and 42.0 to the same on-wire shape. To keep diff/apply
self-consistent across the wire, equality on PropValue treats
I64(42), U64(42), and F64(42.0) as equal. Without this,
tree_diff produces a spurious update_props op whenever a value
passes through a numeric round-trip (animations interpolate to
F64 while authored props start as I64, etc.).
Borrow the value as a str.
Return the value as an f64 when conversion is finite and exact.
Borrow the value as a bool.
Return the value as an i64 when conversion is integral and in range.
Return the value as a u64 when conversion is integral and in range.
Borrow the value as an array.
Borrow the value as an object.
Returns true when the null condition holds.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Decode from a wire-format JSON value.
Encode to PropValue for wire transport / direct mode.
Wire type name for diagnostics.
Extract this type from a Props store by key.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.