pub enum AppEvent {
Show 21 variants
ServerStarted {
model_id: i64,
model_name: String,
port: u16,
},
ServerStopped {
model_id: i64,
model_name: String,
},
ServerError {
model_id: Option<i64>,
model_name: String,
error: RuntimeErrorEnvelope,
},
ServerSnapshot {
servers: Vec<ServerSnapshotEntry>,
},
Download {
event: DownloadEvent,
},
ModelAdded {
model: ModelSummary,
},
ModelRemoved {
model_id: i64,
},
ModelUpdated {
model: ModelSummary,
},
VerificationProgress {
model_id: i64,
model_name: String,
shard_name: String,
bytes_processed: u64,
total_bytes: u64,
},
VerificationComplete {
model_id: i64,
model_name: String,
overall_health: OverallHealth,
},
ServerHealthChanged {
server_id: i64,
model_id: i64,
status: ServerHealthStatus,
detail: Option<String>,
timestamp: u64,
},
ProxyStarted {
port: u16,
},
ProxyStopped,
ProxyCrashed,
RemoteEnabled {
ticket_fingerprint: String,
},
RemoteDisabled,
RemotePaired {
peer: Option<String>,
},
RemoteConnected {
port: u16,
},
RemoteDisconnected,
RemoteAway {
port: u16,
},
RemoteBack {
port: u16,
},
}Expand description
Canonical event types for all adapters.
This enum unifies server, download, and model events into a single discriminated union. Each variant includes all necessary context for the event to be self-describing.
Variants§
ServerStarted
A model server has started and is ready to accept requests.
Fields
ServerStopped
A model server has been stopped (clean shutdown).
Fields
ServerError
A model server encountered an error.
Fields
model_id: Option<i64>ID of the model being served (if known).
Serde always sends the key — an unparseable model ID arrives as
null, not as an absent field.
error: RuntimeErrorEnvelopeStructured error detail (message, type discriminant, retryable
flag), mirroring the HTTP layer’s ErrorResponse shape.
ServerSnapshot
Snapshot of all currently running servers.
Fields
servers: Vec<ServerSnapshotEntry>List of currently running servers.
Download
Download lifecycle + progress events (including shard progress).
Wraps DownloadEvent verbatim to preserve all detail including
shard-specific progress information.
Fields
event: DownloadEventThe download event payload.
ModelAdded
A model was added to the library.
Fields
model: ModelSummarySummary of the added model.
ModelRemoved
A model was removed from the library.
ModelUpdated
A model was updated in the library.
Fields
model: ModelSummarySummary of the updated model.
VerificationProgress
Model verification progress update.
Fields
VerificationComplete
Model verification completed.
Fields
overall_health: OverallHealthOverall health status.
ServerHealthChanged
Server health status has changed.
Emitted by continuous monitoring when a server’s health state changes.
Fields
status: ServerHealthStatusNew health status.
ProxyStarted
The OpenAI-compatible proxy has started.
ProxyStopped
The proxy has been stopped (clean shutdown).
ProxyCrashed
The proxy crashed (task exited without cancellation).
RemoteEnabled
The remote tunnel is up and has a ticket. The ticket itself is never on the event stream — any local GUI client can read it — so this carries the same twelve-character fingerprint the logs use.
RemoteDisabled
The remote tunnel was taken down; nothing answers its ticket until
enable puts the same one back.
RemotePaired
A device redeemed the pairing code and now holds the key.
RemoteConnected
This machine’s connect side is up: a local port that is the remote proxy.
RemoteDisconnected
The connect side was taken down.
RemoteAway
The far machine has been away past the grace. The port stays bound and is still being dialled; this says so, so a client is not left reading “connected” over nothing.
RemoteBack
The far machine answered again after being away.
Implementations§
Source§impl AppEvent
impl AppEvent
Sourcepub const fn model_added(model: ModelSummary) -> Self
pub const fn model_added(model: ModelSummary) -> Self
Create a model added event.
Sourcepub const fn model_removed(model_id: i64) -> Self
pub const fn model_removed(model_id: i64) -> Self
Create a model removed event.
Sourcepub const fn model_updated(model: ModelSummary) -> Self
pub const fn model_updated(model: ModelSummary) -> Self
Create a model updated event.
Source§impl AppEvent
impl AppEvent
Sourcepub const fn remote_enabled(ticket_fingerprint: String) -> Self
pub const fn remote_enabled(ticket_fingerprint: String) -> Self
Create a AppEvent::RemoteEnabled event.
Sourcepub const fn remote_disabled() -> Self
pub const fn remote_disabled() -> Self
Create a AppEvent::RemoteDisabled event.
Sourcepub const fn remote_paired(peer: Option<String>) -> Self
pub const fn remote_paired(peer: Option<String>) -> Self
Create a AppEvent::RemotePaired event.
Sourcepub const fn remote_connected(port: u16) -> Self
pub const fn remote_connected(port: u16) -> Self
Create a AppEvent::RemoteConnected event.
Sourcepub const fn remote_disconnected() -> Self
pub const fn remote_disconnected() -> Self
Create a AppEvent::RemoteDisconnected event.
Sourcepub const fn remote_away(port: u16) -> Self
pub const fn remote_away(port: u16) -> Self
Create a AppEvent::RemoteAway event.
Sourcepub const fn remote_back(port: u16) -> Self
pub const fn remote_back(port: u16) -> Self
Create a AppEvent::RemoteBack event.
Source§impl AppEvent
impl AppEvent
Sourcepub fn server_started(
model_id: i64,
model_name: impl Into<String>,
port: u16,
) -> Self
pub fn server_started( model_id: i64, model_name: impl Into<String>, port: u16, ) -> Self
Create a server started event.
Sourcepub fn server_stopped(model_id: i64, model_name: impl Into<String>) -> Self
pub fn server_stopped(model_id: i64, model_name: impl Into<String>) -> Self
Create a server stopped event.
Sourcepub fn server_error(
model_id: Option<i64>,
model_name: impl Into<String>,
error: RuntimeErrorEnvelope,
) -> Self
pub fn server_error( model_id: Option<i64>, model_name: impl Into<String>, error: RuntimeErrorEnvelope, ) -> Self
Create a server error event.
Sourcepub const fn server_snapshot(servers: Vec<ServerSnapshotEntry>) -> Self
pub const fn server_snapshot(servers: Vec<ServerSnapshotEntry>) -> Self
Create a server snapshot event.
Sourcepub fn from_server_started(server: &ServerSummary) -> Self
pub fn from_server_started(server: &ServerSummary) -> Self
Build a ServerStarted event from a ServerSummary.
Sourcepub fn from_server_stopped(server: &ServerSummary) -> Self
pub fn from_server_stopped(server: &ServerSummary) -> Self
Build a ServerStopped event from a ServerSummary.
Sourcepub fn from_server_error(
server: &ServerSummary,
error: RuntimeErrorEnvelope,
) -> Self
pub fn from_server_error( server: &ServerSummary, error: RuntimeErrorEnvelope, ) -> Self
Build a ServerError event from a ServerSummary.
Sourcepub fn from_server_snapshot(servers: &[ServerSummary]) -> Self
pub fn from_server_snapshot(servers: &[ServerSummary]) -> Self
Build a ServerSnapshot event from a slice of ServerSummary.
Source§impl AppEvent
impl AppEvent
Sourcepub const fn event_name(&self) -> &'static str
pub const fn event_name(&self) -> &'static str
Colon-separated event names.
Not what goes on the wire. AppEvent is #[serde(tag = "type", rename_all = "snake_case")], so SSE carries download/model_added;
these download:started spellings are the Tauri-bus vocabulary from
before the GUI backend moved into the daemon, and the Tauri event
branch that subscribed to them is gone.
Nothing outside this module’s tests calls it. Retiring it belongs with the rest of the residual-Rust sweep, not here.
Source§impl AppEvent
impl AppEvent
Sourcepub const fn proxy_started(port: u16) -> Self
pub const fn proxy_started(port: u16) -> Self
Create a AppEvent::ProxyStarted event.
Sourcepub const fn proxy_stopped() -> Self
pub const fn proxy_stopped() -> Self
Create a AppEvent::ProxyStopped event.
Sourcepub const fn proxy_crashed() -> Self
pub const fn proxy_crashed() -> Self
Create a AppEvent::ProxyCrashed event.