Skip to main content

AppEvent

Enum AppEvent 

Source
#[non_exhaustive]
pub enum AppEvent { BackgroundComplete { operation_id: String, }, BackgroundProgress { operation_id: String, percent: f32, message: String, }, External(Box<dyn Any + Send>), SubscriptionEvent { sub_id: SubscriptionId, event: Box<dyn Any + Send>, }, I18nReload { locale: String, path: PathBuf, }, SettingsReload { path: PathBuf, }, SettingsWriteFailed { path: PathBuf, attempts: u32, dropped_patches: usize, message: String, }, }
Expand description

Events posted to the UI thread from background threads or timers.

Non-exhaustive: a match on it outside teksilo-core needs a wildcard arm.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BackgroundComplete

A background operation completed.

Fields

§operation_id: String
§

BackgroundProgress

A background operation reports progress.

Fields

§operation_id: String
§percent: f32
§message: String
§

External(Box<dyn Any + Send>)

An external event from any source (type-erased for extensibility).

§

SubscriptionEvent

A backend event delivered to a widget that subscribed via BuildContext::subscribe_event. The sub_id keys the UI-side callback in the tree’s TreeAppContext::subscription_callbacks map; the event is downcast back to the subscriber’s expected type.

Fields

§event: Box<dyn Any + Send>
§

I18nReload

An .ftl translation file registered via I18nConfig::runtime_override(locale, path) changed on disk. The teksilo-app handler calls I18nManager::reload_from_path and bumps the translation version signal.

Fields

§locale: String
§path: PathBuf
§

SettingsReload

A settings file managed by teksilo-settings changed on disk — either a peer process’s write, or (harmlessly) this very process’s own write being noticed by its own watcher. The teksilo-app handler looks path up in the app’s teksilo_settings::SettingsRegistry (via app_state) and calls Reloadable::reload_from_disk on whatever owns it — a no-op if nothing is registered for that path, or if the content is unchanged (the self-write case).

Fields

§path: PathBuf
§

SettingsWriteFailed

A teksilo-settings DebouncedWriter gave up on a queued write — after MAX_WRITE_ATTEMPTS retries, or at Unregister teardown with a write still failing. The queued patches for path were permanently discarded.

Fields

§path: PathBuf
§attempts: u32
§dropped_patches: usize
§message: String

Trait Implementations§

Source§

impl Debug for AppEvent

Source§

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

Formats the value using the given formatter. 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.