pub enum AppEvent {
Show 14 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: String,
},
ServerSnapshot {
servers: Vec<ServerSnapshotEntry>,
},
Download {
event: DownloadEvent,
},
ModelAdded {
model: ModelSummary,
},
ModelRemoved {
model_id: i64,
},
ModelUpdated {
model: ModelSummary,
},
ServerHealthChanged {
server_id: i64,
model_id: i64,
status: ServerHealthStatus,
detail: Option<String>,
timestamp: u64,
},
McpServerAdded {
server: McpServerSummary,
},
McpServerRemoved {
server_id: i64,
},
McpServerStarted {
server_id: i64,
server_name: String,
},
McpServerStopped {
server_id: i64,
server_name: String,
},
McpServerError {
error: McpErrorInfo,
},
}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
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.
ServerHealthChanged
Server health status has changed.
Emitted by continuous monitoring when a server’s health state changes.
Fields
status: ServerHealthStatusNew health status.
McpServerAdded
An MCP server was added to the configuration.
Fields
server: McpServerSummarySummary of the added server.
McpServerRemoved
An MCP server was removed from the configuration.
McpServerStarted
An MCP server has started and is ready.
McpServerStopped
An MCP server has been stopped.
McpServerError
An MCP server encountered an error.
Fields
error: McpErrorInfoUser-safe error information.
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 fn download_started(
id: impl Into<String>,
_display_name: impl Into<String>,
) -> Self
pub fn download_started( id: impl Into<String>, _display_name: impl Into<String>, ) -> Self
Create a download started event.
Sourcepub fn download_progress(
id: impl Into<String>,
downloaded: u64,
total: u64,
speed_bps: f64,
eta_seconds: f64,
percentage: f64,
) -> Self
pub fn download_progress( id: impl Into<String>, downloaded: u64, total: u64, speed_bps: f64, eta_seconds: f64, percentage: f64, ) -> Self
Create a download progress event.
Sourcepub fn download_completed(
id: impl Into<String>,
message: Option<String>,
) -> Self
pub fn download_completed( id: impl Into<String>, message: Option<String>, ) -> Self
Create a download completed event.
Sourcepub fn download_failed(id: impl Into<String>, error: impl Into<String>) -> Self
pub fn download_failed(id: impl Into<String>, error: impl Into<String>) -> Self
Create a download failed event.
Sourcepub fn download_cancelled(id: impl Into<String>) -> Self
pub fn download_cancelled(id: impl Into<String>) -> Self
Create a download cancelled event.
Source§impl AppEvent
impl AppEvent
Sourcepub const fn mcp_server_added(server: McpServerSummary) -> Self
pub const fn mcp_server_added(server: McpServerSummary) -> Self
Create an MCP server added event.
Sourcepub const fn mcp_server_removed(server_id: i64) -> Self
pub const fn mcp_server_removed(server_id: i64) -> Self
Create an MCP server removed event.
Sourcepub fn mcp_server_started(
server_id: i64,
server_name: impl Into<String>,
) -> Self
pub fn mcp_server_started( server_id: i64, server_name: impl Into<String>, ) -> Self
Create an MCP server started event.
Sourcepub fn mcp_server_stopped(
server_id: i64,
server_name: impl Into<String>,
) -> Self
pub fn mcp_server_stopped( server_id: i64, server_name: impl Into<String>, ) -> Self
Create an MCP server stopped event.
Sourcepub const fn mcp_server_error(error: McpErrorInfo) -> Self
pub const fn mcp_server_error(error: McpErrorInfo) -> Self
Create an MCP server error 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: impl Into<String>,
) -> Self
pub fn server_error( model_id: Option<i64>, model_name: impl Into<String>, error: impl Into<String>, ) -> 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.