Skip to main content

AppEvent

Enum AppEvent 

Source
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

§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).

Serde always sends the key — an unparseable model ID arrives as null, not as an absent field.

§model_name: String

Name of the model being served.

§error: RuntimeErrorEnvelope

Structured 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: 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.

§

VerificationProgress

Model verification progress update.

Fields

§model_id: i64

ID of the model being verified.

§model_name: String

Name of the model being verified.

§shard_name: String

Name of the shard being verified.

§bytes_processed: u64

Bytes processed so far.

§total_bytes: u64

Total bytes to process.

§

VerificationComplete

Model verification completed.

Fields

§model_id: i64

ID of the verified model.

§model_name: String

Name of the verified model.

§overall_health: OverallHealth

Overall health status.

§

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.

§

ProxyStarted

The OpenAI-compatible proxy has started.

Fields

§port: u16

Port the proxy is listening on.

§

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.

Fields

§ticket_fingerprint: String

Fingerprint of the ticket this session minted.

§

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.

Fields

§peer: Option<String>

The tunnel edge’s fingerprint for that device, when it sent one.

§

RemoteConnected

This machine’s connect side is up: a local port that is the remote proxy.

Fields

§port: u16

The loopback port the tunnel is bound to on this machine.

§

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.

Fields

§port: u16

The loopback port that is still bound.

§

RemoteBack

The far machine answered again after being away.

Fields

§port: u16

The loopback port, unchanged.

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 const fn remote_enabled(ticket_fingerprint: String) -> Self

Create a AppEvent::RemoteEnabled event.

Source

pub const fn remote_disabled() -> Self

Create a AppEvent::RemoteDisabled event.

Source

pub const fn remote_paired(peer: Option<String>) -> Self

Create a AppEvent::RemotePaired event.

Source

pub const fn remote_connected(port: u16) -> Self

Create a AppEvent::RemoteConnected event.

Source

pub const fn remote_disconnected() -> Self

Source

pub const fn remote_away(port: u16) -> Self

Create a AppEvent::RemoteAway event.

Source

pub const fn remote_back(port: u16) -> Self

Create a AppEvent::RemoteBack 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: RuntimeErrorEnvelope, ) -> Self

Create a server error event.

Source

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

Create a server snapshot event.

Source

pub fn from_server_started(server: &ServerSummary) -> Self

Build a ServerStarted event from a ServerSummary.

Source

pub fn from_server_stopped(server: &ServerSummary) -> Self

Build a ServerStopped event from a ServerSummary.

Source

pub fn from_server_error( server: &ServerSummary, error: RuntimeErrorEnvelope, ) -> Self

Build a ServerError event from a ServerSummary.

Source

pub fn from_server_snapshot(servers: &[ServerSummary]) -> Self

Build a ServerSnapshot event from a slice of ServerSummary.

Source§

impl AppEvent

Source

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

Source

pub const fn proxy_started(port: u16) -> Self

Create a AppEvent::ProxyStarted event.

Source

pub const fn proxy_stopped() -> Self

Create a AppEvent::ProxyStopped event.

Source

pub const fn proxy_crashed() -> Self

Create a AppEvent::ProxyCrashed event.

Trait Implementations§

Source§

impl Clone for AppEvent

Source§

fn clone(&self) -> AppEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

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