pub enum Outgoing {
WriteValuesResp {
success: bool,
message: Option<String>,
},
ReadValuesResp {
values: HashMap<String, Value>,
},
ListKeysResp {
keys: Vec<KeyInfo>,
},
ListMethodsResp {
methods: Vec<MethodInfo>,
},
InvokeResp {
success: bool,
request_id: Option<String>,
value: Option<Value>,
message: Option<String>,
},
Error {
request_id: Option<String>,
message: String,
},
ValuesChanged {
values: HashMap<String, Value>,
},
}Expand description
Messages sent to WebSocket clients.
All outgoing messages use a type field to discriminate the message kind.
Variants§
WriteValuesResp
Response to WriteValues message.
Example: {"type": "write_values_resp", "success": true}
Fields
ReadValuesResp
Response to ReadValues message.
Example: {"type": "read_values_resp", "values": {"face/mouth": {"f64": 0.5}}}
ListKeysResp
Response to ListKeys message.
Example: {"type": "list_keys_resp", "keys": [...]}
ListMethodsResp
Response to ListMethods message.
Example: {"type": "list_methods_resp", "methods": [...]}
Fields
methods: Vec<MethodInfo>List of matching methods
InvokeResp
Response to Invoke message.
Example: {"type": "invoke_resp", "success": true, "request_id": "req-1"}
Fields
Error
Generic error response for parse failures or unknown message types.
Example: {"type": "error", "message": "Invalid JSON"}
Fields
ValuesChanged
Server-initiated push: values changed (e.g. the runtime wrote new state). Sent unsolicited to subscribed clients — the live-edit feed.
Example: {"type": "values_changed", "values": {"face/mouth": {"f64": 0.5}}}