AppEvent

Enum AppEvent 

Source
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

§model_id: i64

ID of the model being served.

§model_name: String

Name of the model being served.

§port: u16

Port the server is listening on.

§

ServerStopped

A model server has been stopped (clean shutdown).

Fields

§model_id: i64

ID of the model that was being served.

§model_name: String

Name of the model that was being served.

§

ServerError

A model server encountered an error.

Fields

§model_id: Option<i64>

ID of the model being served (if known).

§model_name: String

Name of the model being served.

§error: String

Error description.

§

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: DownloadEvent

The download event payload.

§

ModelAdded

A model was added to the library.

Fields

§model: ModelSummary

Summary of the added model.

§

ModelRemoved

A model was removed from the library.

Fields

§model_id: i64

ID of the removed model.

§

ModelUpdated

A model was updated in the library.

Fields

§model: ModelSummary

Summary of the updated model.

§

ServerHealthChanged

Server health status has changed.

Emitted by continuous monitoring when a server’s health state changes.

Fields

§server_id: i64

Unique server instance identifier.

§model_id: i64

ID of the model being served.

§status: ServerHealthStatus

New health status.

§detail: Option<String>

Optional detail message (e.g., error description).

§timestamp: u64

Unix timestamp in milliseconds when status changed.

§

McpServerAdded

An MCP server was added to the configuration.

Fields

§server: McpServerSummary

Summary of the added server.

§

McpServerRemoved

An MCP server was removed from the configuration.

Fields

§server_id: i64

ID of the removed server.

§

McpServerStarted

An MCP server has started and is ready.

Fields

§server_id: i64

ID of the server.

§server_name: String

Name of the server.

§

McpServerStopped

An MCP server has been stopped.

Fields

§server_id: i64

ID of the server.

§server_name: String

Name of the server.

§

McpServerError

An MCP server encountered an error.

Fields

§error: McpErrorInfo

User-safe error information.

Implementations§

Source§

impl AppEvent

Source

pub const fn model_added(model: ModelSummary) -> Self

Create a model added event.

Source

pub const fn model_removed(model_id: i64) -> Self

Create a model removed event.

Source

pub const fn model_updated(model: ModelSummary) -> Self

Create a model updated event.

Source§

impl AppEvent

Source

pub fn download_started( id: impl Into<String>, _display_name: impl Into<String>, ) -> Self

Create a download started event.

Source

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.

Source

pub fn download_completed( id: impl Into<String>, message: Option<String>, ) -> Self

Create a download completed event.

Source

pub fn download_failed(id: impl Into<String>, error: impl Into<String>) -> Self

Create a download failed event.

Source

pub fn download_cancelled(id: impl Into<String>) -> Self

Create a download cancelled event.

Source§

impl AppEvent

Source

pub const fn mcp_server_added(server: McpServerSummary) -> Self

Create an MCP server added event.

Source

pub const fn mcp_server_removed(server_id: i64) -> Self

Create an MCP server removed event.

Source

pub fn mcp_server_started( server_id: i64, server_name: impl Into<String>, ) -> Self

Create an MCP server started event.

Source

pub fn mcp_server_stopped( server_id: i64, server_name: impl Into<String>, ) -> Self

Create an MCP server stopped event.

Source

pub const fn mcp_server_error(error: McpErrorInfo) -> Self

Create an MCP server error event.

Source§

impl AppEvent

Source

pub fn server_started( model_id: i64, model_name: impl Into<String>, port: u16, ) -> Self

Create a server started event.

Source

pub fn server_stopped(model_id: i64, model_name: impl Into<String>) -> Self

Create a server stopped event.

Source

pub fn server_error( model_id: Option<i64>, model_name: impl Into<String>, error: impl Into<String>, ) -> Self

Create a server error event.

Source

pub const fn server_snapshot(servers: Vec<ServerSnapshotEntry>) -> Self

Create a server snapshot event.

Source§

impl AppEvent

Source

pub const fn event_name(&self) -> &'static str

Get the event name for wire protocols.

This provides consistent event naming across Tauri and SSE transports.

Trait Implementations§

Source§

impl Clone for AppEvent

Source§

fn clone(&self) -> AppEvent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AppEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AppEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,