Expand description
§events
Canonical event union for all cross-adapter events.
This module is the single source of truth for events used by SSE handlers and
backend emitters. There is no Tauri-event branch: the desktop app consumes the
same /api/events stream a browser tab does.
§Structure
app- Application-level events (model added/removed/updated)server- Model server lifecycle events
Download events are not a submodule here: AppEvent::Download wraps
crate::download::DownloadEvent verbatim.
§Wire Format
Events are serialized with a type tag for TypeScript compatibility:
{ "type": "server_started", "modelName": "Llama-2-7B", "port": 8080 }server_error carries a structured error envelope (message, stable type
discriminant, retryable flag) rather than a bare string, mirroring the HTTP
layer’s ErrorResponse shape so SSE and HTTP clients agree on meaning:
{
"type": "server_error",
"modelId": 1,
"modelName": "Llama-2-7B",
"error": { "message": "...", "type": "service_unavailable", "retryable": true }
}Modules
| Module | LOC | Complexity | Coverage |
|---|---|---|---|
app.rs | |||
app_event_tests.rs | |||
remote.rs | |||
server.rs |
Modules§
- app 🔒
- Application-level events (model lifecycle).
- remote 🔒
- Constructors for the remote-tunnel events.
- server 🔒
- Model server lifecycle events.
Structs§
- Model
Summary - Summary of a model for event payloads.
- Noop
Server Events - No-op implementation of
ServerEventsfor testing and non-GUI contexts. - Server
Snapshot Entry - Entry in a server snapshot.
- Server
Summary - Summary of a running server for event emission.
Enums§
- AppEvent
- Canonical event types for all adapters.
Traits§
- Server
Events - Port for emitting server lifecycle events.