pub enum PropValue {
String(String),
Number(f64),
Bool(bool),
Nil,
Color {
r: f64,
g: f64,
b: f64,
a: f64,
},
ActionRef {
action: String,
args: Option<Vec<PropValue>>,
},
Lambda {
lambda_id: u32,
},
List(Vec<PropValue>),
Record(BTreeMap<String, PropValue>),
}Expand description
A property value in the Surface tree.
Matches the JSON representation used in the host WASM contract.
Uses BTreeMap for record props to guarantee deterministic serialization.
Variants§
String(String)
String value (e.g., label: "Click me").
Number(f64)
Numeric value (e.g., spacing: 8).
Bool(bool)
Boolean value (e.g., disabled: true).
Nil
Null / absent value.
Color
RGBA color as { r, g, b, a } — each 0.0–1.0.
ActionRef
Action reference (e.g., on_tap: "increment").
Serialized as { "__action": "action_name" } or
{ "__action": "action_name", "__args": [...] }.
Lambda
Lambda / callback reference (e.g., on_change: (s) -> set value = s).
Serialized as { "__lambda": id }. The host resolves the lambda at dispatch time.
List(Vec<PropValue>)
Ordered list of values.
Record(BTreeMap<String, PropValue>)
Named fields. Uses BTreeMap for deterministic ordering.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PropValue
impl<'de> Deserialize<'de> for PropValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for PropValue
Auto Trait Implementations§
impl Freeze for PropValue
impl RefUnwindSafe for PropValue
impl Send for PropValue
impl Sync for PropValue
impl Unpin for PropValue
impl UnwindSafe for PropValue
Blanket Implementations§
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