pub enum PropertyValue {
Bool(bool),
I64(i64),
F64(f64),
Str(Arc<str>),
Color(Color),
Vec2(Vec2),
Custom(Arc<dyn Any + Send + Sync>),
}Expand description
Typed property value. The Custom variant covers Rust types not enumerated here.
Variants§
Bool(bool)
Boolean payload.
I64(i64)
Signed 64-bit integer payload.
F64(f64)
64-bit float payload.
Str(Arc<str>)
Shared string payload.
Color(Color)
RGBA color payload.
Vec2(Vec2)
2-vector payload (typically a logical-pixel position or size).
Custom(Arc<dyn Any + Send + Sync>)
Escape hatch for types not covered by the enumerated variants. The inner Arc is shared cheaply across clones.
Implementations§
Source§impl PropertyValue
impl PropertyValue
Sourcepub fn eq_value(&self, other: &Self) -> bool
pub fn eq_value(&self, other: &Self) -> bool
Structural equality across enumerated variants.
Custom is treated as never-equal - there is no general equality across dyn Any. Treating it as always-changed
is the safe conservative choice for the dirty queue (a redundant notify is fine; a missed notify is not).
Trait Implementations§
Source§impl Clone for PropertyValue
impl Clone for PropertyValue
Source§fn clone(&self) -> PropertyValue
fn clone(&self) -> PropertyValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PropertyValue
impl Debug for PropertyValue
Source§impl From<&str> for PropertyValue
impl From<&str> for PropertyValue
Source§impl From<Color> for PropertyValue
impl From<Color> for PropertyValue
Source§impl From<PropertyValue> for Arc<str>
impl From<PropertyValue> for Arc<str>
Source§fn from(v: PropertyValue) -> Self
fn from(v: PropertyValue) -> Self
Source§impl From<PropertyValue> for Color
impl From<PropertyValue> for Color
Source§fn from(v: PropertyValue) -> Self
fn from(v: PropertyValue) -> Self
Source§impl From<PropertyValue> for String
impl From<PropertyValue> for String
Source§fn from(v: PropertyValue) -> Self
fn from(v: PropertyValue) -> Self
Source§impl From<PropertyValue> for Vec2
impl From<PropertyValue> for Vec2
Source§fn from(v: PropertyValue) -> Self
fn from(v: PropertyValue) -> Self
Source§impl From<PropertyValue> for bool
Inverse impls - used by crate::traits::Bindable::write to receive a typed value from the store.
impl From<PropertyValue> for bool
Inverse impls - used by crate::traits::Bindable::write to receive a typed value from the store.
These fall back to the type’s Default when the stored value has the wrong variant. Callers who want strict typing
should read the cell directly and pattern-match.