pub struct Settings {
pub theme_name: Option<String>,
pub selected_cleaners: Vec<String>,
}Expand description
Persisted user preferences.
Fields§
§theme_name: Option<String>Name of the selected theme (see crate::theme::THEME_NAMES).
Stored by name (not index) so preset reordering across releases
doesn’t silently change a user’s saved theme.
selected_cleaners: Vec<String>Names of cleaners that were selected (checked) the last time the
app was closed, restored on next launch. Stored as "Category: Item"
pairs so identically-named cleaners in different categories don’t
collide.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn theme_index(&self) -> usize
pub fn theme_index(&self) -> usize
Resolve the persisted theme name to an index via
crate::theme::theme_index_by_name, defaulting to 0.
Sourcepub fn selection_key(category_name: &str, item_name: &str) -> String
pub fn selection_key(category_name: &str, item_name: &str) -> String
Build the "Category: Item" key used to identify a selected cleaner.
Sourcepub fn is_selected(&self, category_name: &str, item_name: &str) -> bool
pub fn is_selected(&self, category_name: &str, item_name: &str) -> bool
Whether the given category/item pair was selected last time.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnsafeUnpin for Settings
impl UnwindSafe for Settings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more