Skip to main content

SettingsExt

Trait SettingsExt 

Source
pub trait SettingsExt {
    // Required methods
    fn try_settings(&self) -> Option<&SettingsStore>;
    fn try_window_state(&self) -> Option<&WindowStateService>;
    fn try_mru<T: MruEntry>(&self) -> Option<&MruList<T>>;

    // Provided methods
    fn settings(&self) -> &SettingsStore { ... }
    fn window_state(&self) -> &WindowStateService { ... }
    fn mru<T: MruEntry>(&self) -> &MruList<T> { ... }
}
Expand description

Convenience accessors for settings services attached to the app’s app_state registry.

Required Methods§

Source

fn try_settings(&self) -> Option<&SettingsStore>

Returns the K/V settings store, or None if not registered.

Source

fn try_window_state(&self) -> Option<&WindowStateService>

Returns the window-state service, or None if not registered.

Source

fn try_mru<T: MruEntry>(&self) -> Option<&MruList<T>>

Returns the MRU list for T, or None if no MruList<T> was registered.

Provided Methods§

Source

fn settings(&self) -> &SettingsStore

The K/V settings store. Panics if TeksiloAppBuilder::settings(...) was not called.

Source

fn window_state(&self) -> &WindowStateService

The window-state service. Panics if not registered.

Source

fn mru<T: MruEntry>(&self) -> &MruList<T>

An app-defined MRU list. Panics if no MruList<T> was registered for that exact T via TeksiloAppBuilder::app_state(mru_handle.clone()).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a> SettingsExt for BuildContext<'a>

Source§

impl<'a> SettingsExt for EventContext<'a>

Implementors§