Skip to main content

EdgeToServer

Enum EdgeToServer 

Source
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>,
    },
}
Expand description

Frames sent from an edge-agent to weave-server.

Variants§

§

Hello

First frame after connect. Declares identity and adapter capabilities.

Fields

§edge_id: String
§version: String
§capabilities: Vec<String>
§

State

State update for a service target (e.g. Roon zone playback / volume).

Fields

§service_type: String
§target: String
§property: String
§output_id: Option<String>
§value: Value
§

DeviceState

State update for a device (battery, RSSI, connected).

Fields

§device_type: String
§device_id: String
§property: String
§value: Value
§

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.

Fields

§mapping_id: Uuid
§service_target: String
§

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

§service_type: String
§target: String
§intent: String

Snake-case intent name (volume_change, play_pause, …).

§params: Value

Intent parameters serialized as JSON. Shape matches the weave-engine::Intent discriminant’s payload.

§latency_ms: Option<u32>
§output_id: Option<String>
§

Error

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.

Fields

§context: String
§message: String
§severity: ErrorSeverity
§

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

§wifi: Option<u8>

Wifi signal strength normalized to 0..=100 percent. None when the platform doesn’t expose a signal-strength API to user code, when the host has no wifi adapter, or when the API call failed (entitlement missing, permission denied).

Trait Implementations§

Source§

impl Clone for EdgeToServer

Source§

fn clone(&self) -> EdgeToServer

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EdgeToServer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for EdgeToServer

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for EdgeToServer

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,