pub enum ServerEvent {
Opened {
id: SessionId,
name: String,
port: u16,
},
Attached {
id: SessionId,
reattached: bool,
},
Bytes {
id: SessionId,
data: Vec<u8>,
},
Disconnected {
id: SessionId,
},
Closed {
id: SessionId,
},
}Expand description
Something the UI needs to know about.
Variants§
Opened
A new session exists; open a window for it.
Attached
A data socket just attached to a session (live flipped false ->
true). Fires for the ordinary first attach of a brand-new session
and every later reattach — reattached tells the two apart so the
UI draws its “– reconnected –” rule only for a genuine rejoin.
This subsumes the old handshake-level Reconnected event: a
repeat HELLO only ever matters to the UI once the client’s data
socket actually attaches, so attach is the single source of truth
for “connected” (see .superpowers/sdd/lifecycle-fixes-report.md,
defect 1).
Bytes
Stream bytes for a session.
Disconnected
The data socket closed; the session and its port stay alive.
Closed
The session’s idle TTL expired and it was dropped; close its window.
Sent by Server::reap, on the same channel as every other
lifecycle event.
Trait Implementations§
Source§impl Clone for ServerEvent
impl Clone for ServerEvent
Source§fn clone(&self) -> ServerEvent
fn clone(&self) -> ServerEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more