Skip to main content

Module events

Module events 

Source
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

ModuleLOCComplexityCoverage
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§

ModelSummary
Summary of a model for event payloads.
NoopServerEvents
No-op implementation of ServerEvents for testing and non-GUI contexts.
ServerSnapshotEntry
Entry in a server snapshot.
ServerSummary
Summary of a running server for event emission.

Enums§

AppEvent
Canonical event types for all adapters.

Traits§

ServerEvents
Port for emitting server lifecycle events.