pub enum EdgeToServer {
Hello {
edge_id: String,
version: String,
capabilities: Vec<String>,
},
State {
service_type: String,
target: String,
property: String,
output_id: Option<String>,
value: Value,
},
DeviceState {
device_type: String,
device_id: String,
property: String,
value: Value,
},
Pong,
SwitchTarget {
mapping_id: Uuid,
service_target: String,
},
Command {
service_type: String,
target: String,
intent: String,
params: Value,
result: CommandResult,
latency_ms: Option<u32>,
output_id: Option<String>,
},
Error {
context: String,
message: String,
severity: ErrorSeverity,
},
EdgeStatus {
wifi: Option<u8>,
},
DispatchIntent {
service_type: String,
service_target: String,
intent: String,
params: Value,
output_id: Option<String>,
},
SwitchActiveConnection {
device_type: String,
device_id: String,
active_mapping_id: Uuid,
},
}Expand description
Frames sent from an edge-agent to weave-server.
Variants§
Hello
First frame after connect. Declares identity and adapter capabilities.
State
State update for a service target (e.g. Roon zone playback / volume).
DeviceState
State update for a device (battery, RSSI, connected).
Pong
Reply to server Ping.
SwitchTarget
The edge committed a target switch via on-device selection mode.
Server replies by calling the same code path as POST /api/mappings/:id/target: persist the new service_target, then
broadcast a ConfigPatch upsert back to all edges (including the
sender) and a MappingChanged to UI subscribers.
Command
A command that the edge’s adapter emitted to an external service
(Roon MOO RPC, Hue REST, …). One frame per adapter.send_intent
call, carrying the outcome and measured latency so the UI live
stream can show “sent → ok (42ms)” rows alongside input and
state-echo rows.
Fields
params: ValueIntent parameters serialized as JSON. Shape matches the
weave-engine::Intent discriminant’s payload.
result: CommandResultError
Adapter-level or routing-level error not tied to a specific
command (bridge disconnect, auth token expired, pairing lost).
Command-level failures use Command { result: Err { .. } }
instead — Error is for ambient conditions.
EdgeStatus
Periodic edge-side metrics. Emitted on a fixed cadence (typically
every 10 s) so the server can surface edge health in /ws/ui
dashboards. Server-side latency is measured separately from
Ping/Pong round trips and is not carried here.
Fields
DispatchIntent
Edge routed an input locally but has no adapter for the resulting
service_type and asks the server to forward to a capable peer.
The server resolves a target edge from Hello capabilities and
re-emits as ServerToEdge::DispatchIntent. Wire shape mirrors
Command (intent name + params) so the same reassembly logic
works on both ends.
The originating edge does NOT emit a Command frame for
forwarded intents — the executing edge does that after running
the adapter, so latency measurement reflects the full path.
Fields
SwitchActiveConnection
The edge advanced its local cycle (typically via cycle_gesture
firing on the device) and asks the server to persist the new
active. Server applies the change, broadcasts
UiFrame::DeviceCycleChanged to web UIs, and echoes
ServerToEdge::SwitchActiveConnection to other edges that observe
the same device so they stay in sync.
Trait Implementations§
Source§impl Clone for EdgeToServer
impl Clone for EdgeToServer
Source§fn clone(&self) -> EdgeToServer
fn clone(&self) -> EdgeToServer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more