Skip to main content

ServerToEdge

Enum ServerToEdge 

Source
pub enum ServerToEdge {
    ConfigFull {
        config: EdgeConfig,
    },
    ConfigPatch {
        mapping_id: Uuid,
        op: PatchOp,
        mapping: Option<Mapping>,
    },
    TargetSwitch {
        mapping_id: Uuid,
        service_target: String,
    },
    GlyphsUpdate {
        glyphs: Vec<Glyph>,
    },
    DisplayGlyph {
        device_type: String,
        device_id: String,
        pattern: String,
        brightness: Option<f32>,
        timeout_ms: Option<u32>,
        transition: Option<String>,
    },
    DeviceConnect {
        device_type: String,
        device_id: String,
    },
    DeviceDisconnect {
        device_type: String,
        device_id: String,
    },
    DispatchIntent {
        service_type: String,
        service_target: String,
        intent: String,
        params: Value,
        output_id: Option<String>,
    },
    DeviceCyclePatch {
        cycle: DeviceCycle,
        op: PatchOp,
    },
    SwitchActiveConnection {
        device_type: String,
        device_id: String,
        active_mapping_id: Uuid,
    },
    ServiceState {
        edge_id: String,
        service_type: String,
        target: String,
        property: String,
        output_id: Option<String>,
        value: Value,
    },
    Ping,
}
Expand description

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

Variants§

§

ConfigFull

Full config snapshot. Sent on (re)connect and on bulk reload.

Fields

§config: EdgeConfig
§

ConfigPatch

Incremental mapping change.

Fields

§mapping_id: Uuid
§mapping: Option<Mapping>
§

TargetSwitch

Server-initiated active-target switch for an existing mapping.

Fields

§mapping_id: Uuid
§service_target: String
§

GlyphsUpdate

Replace the edge’s glyph set. Sent after any glyph CRUD on the server.

Fields

§glyphs: Vec<Glyph>
§

DisplayGlyph

Render a glyph on a specific device immediately. Used by the weave-web “Test LED” affordance to verify a device’s display path without waiting for a service-state event.

Fields

§device_type: String
§device_id: String
§pattern: String

9-line ASCII grid (* = on, anything else = off). Matches the Glyph::pattern shape used in GlyphsUpdate.

§brightness: Option<f32>

Brightness 0.0..=1.0. Defaults to 1.0 when absent.

§timeout_ms: Option<u32>

Auto-clear timeout in milliseconds. Defaults to a short value when absent so test renders don’t linger.

§transition: Option<String>

Transition kind ("immediate" or "cross_fade"). Defaults to cross-fade when absent.

§

DeviceConnect

Server-initiated request to (re)connect a specific device. Idempotent — already-connected devices are a no-op aside from clearing any “paused” state that previously suppressed reconnect attempts.

Fields

§device_type: String
§device_id: String
§

DeviceDisconnect

Server-initiated request to disconnect a specific device. Sets a paused flag so the auto-reconnect loop does not immediately re-establish the link.

Fields

§device_type: String
§device_id: String
§

DispatchIntent

Server-forwarded intent dispatch. The originating edge routed an input but lacked the adapter for service_type; the server looked up an edge whose Hello capabilities include service_type and forwarded the intent here. The receiving edge feeds the payload into its existing dispatcher (same path the local routing engine uses) so an EdgeToServer::Command telemetry frame still emits with the actual outcome.

Wire shape mirrors EdgeToServer::Command (intent name + params) so receivers can reuse the same Intent reassembly logic both for self-routed intents and forwarded ones.

Fields

§service_type: String
§service_target: String
§intent: String

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

§params: Value

Intent parameters serialized as JSON. Shape matches the Intent enum’s payload after #[serde(tag = "type")] lifts the discriminant out.

§output_id: Option<String>
§

DeviceCyclePatch

Incremental cycle change for one device. Sent to the edge that owns the device whenever the server applies a cycle CRUD operation. op == Delete removes the cycle on the edge (mappings revert to the no-cycle “fire all matching” behavior).

Fields

§

SwitchActiveConnection

Server-initiated active-connection switch for a device’s cycle. The receiving edge updates its local cycle snapshot and routes input only through active_mapping_id going forward (until the next switch). Originates from a REST POST .../cycle/switch, an EdgeToServer::SwitchActiveConnection from a peer edge that observed the cycle gesture, or an automatic advance.

Fields

§device_type: String
§device_id: String
§active_mapping_id: Uuid
§

ServiceState

Echo of a service state update originally published by another edge. weave-server fans out EdgeToServer::State to every other connected edge so locally-mapped Nuimos can render LED feedback for services the edge itself doesn’t dispatch (cross-edge scenario: iPad maps Nuimo → Roon, but Roon adapter lives on a peer edge). Receiver feeds this directly into its local feedback pump as a StateUpdate. The edge_id carries the originating edge so receivers can ignore loop-backs (server already filters the source out, but the field is useful for diagnostics).

Fields

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

Ping

Periodic keepalive to keep NAT/proxies open and detect half-open TCP.

Trait Implementations§

Source§

impl Clone for ServerToEdge

Source§

fn clone(&self) -> ServerToEdge

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 ServerToEdge

Source§

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

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

impl<'de> Deserialize<'de> for ServerToEdge

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 ServerToEdge

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>,