pub enum WireMessage {
Snapshot(SystemSnapshot),
Heartbeat {
server_version: String,
uptime_secs: u64,
},
Error {
code: u16,
message: String,
},
Hello {
client_version: String,
auth_token: Option<String>,
},
Welcome {
server_version: String,
hostname: String,
refresh_hz: u32,
},
}Expand description
Wire protocol messages exchanged between muxtop client and server.
Uses a custom Debug impl to redact auth_token in Hello messages,
preventing accidental token leakage in logs or panic messages.
Variants§
Snapshot(SystemSnapshot)
Full system snapshot (server → client).
Heartbeat
Keepalive heartbeat (server → client).
Error
Error message (server → client).
Hello
Client handshake (client → server).
Welcome
Server handshake response (server → client).
Implementations§
Source§impl WireMessage
impl WireMessage
Sourcepub fn encode_snapshot_ref(snap: &SystemSnapshot) -> Result<Frame, ProtoError>
pub fn encode_snapshot_ref(snap: &SystemSnapshot) -> Result<Frame, ProtoError>
Encode a SystemSnapshot into a Snapshot frame without taking
ownership of the snapshot.
Per ADR-30-4 the relay path holds an Arc<SystemSnapshot> and needs to
produce a single encoded Frame that it can then broadcast as bytes to
every client task. Calling to_frame() would require constructing a
WireMessage::Snapshot variant that owns the SystemSnapshot, which
defeats the whole point of the Arc. This helper bypasses the wrapper
and encodes directly from a borrow.
Sourcepub fn from_frame(frame: &Frame) -> Result<Self, ProtoError>
pub fn from_frame(frame: &Frame) -> Result<Self, ProtoError>
Deserialize a Frame into a WireMessage.
Trait Implementations§
Source§impl Clone for WireMessage
impl Clone for WireMessage
Source§fn clone(&self) -> WireMessage
fn clone(&self) -> WireMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more