Trait SettingsLoader

Source
pub trait SettingsLoader:
    Sized
    + Serialize
    + Default {
    const SETTINGS_FILE: &'static str;

    // Required method
    fn from_str(s: &str) -> Result<Self, String>;

    // Provided methods
    fn load() -> Self { ... }
    fn is_file_exists() -> bool { ... }
    fn save(&self) { ... }
}

Required Associated Constants§

Source

const SETTINGS_FILE: &'static str

Required Methods§

Source

fn from_str(s: &str) -> Result<Self, String>

Provided Methods§

Source

fn load() -> Self

Source

fn is_file_exists() -> bool

Source

fn save(&self)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl SettingsLoader for Settings

Source§

const SETTINGS_FILE: &'static str = "plugs.toml"

Source§

impl SettingsLoader for ProjectSettings

Source§

const SETTINGS_FILE: &'static str = "projects.toml"

Source§

impl SettingsLoader for WindowState

Source§

const SETTINGS_FILE: &'static str = "window.toml"