pub struct AppSettings {
pub nexus_api_key: String,
pub game_paths: SmallVec<[GamePath; 4]>,
pub download_dir: Option<PathBuf>,
pub theme: String,
pub selected_game: Option<String>,
pub update_check: UpdateCheckSettings,
pub database: DatabaseSettings,
}Expand description
Persistent application settings shared between CLI and UI.
Stored as TOML at <config_dir>/modde/settings.toml.
Fields§
§nexus_api_key: String§game_paths: SmallVec<[GamePath; 4]>Configured game install paths — typically 1–4 games.
SmallVec<[_; 4]> keeps ≤4 entries inline (no heap allocation).
download_dir: Option<PathBuf>§theme: String§selected_game: Option<String>§update_check: UpdateCheckSettings§database: DatabaseSettingsStorage backend selection. Defaults to SQLite; omitted from old
settings.toml files, which therefore keep using SQLite unchanged.
Implementations§
Source§impl AppSettings
impl AppSettings
Sourcepub fn config_path() -> PathBuf
pub fn config_path() -> PathBuf
Path to the settings.toml file backing AppSettings.
pub fn load() -> Self
pub fn save(&self)
Sourcepub fn game_path(&self, game_id: &GameId) -> Option<&PathBuf>
pub fn game_path(&self, game_id: &GameId) -> Option<&PathBuf>
Get the install path for a game, if configured.
Sourcepub fn set_game_path(&mut self, game_id: &GameId, path: PathBuf)
pub fn set_game_path(&mut self, game_id: &GameId, path: PathBuf)
Set the install path for a game (add or update).
Trait Implementations§
Source§impl Clone for AppSettings
impl Clone for AppSettings
Source§fn clone(&self) -> AppSettings
fn clone(&self) -> AppSettings
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AppSettings
impl Debug for AppSettings
Source§impl Default for AppSettings
impl Default for AppSettings
Source§fn default() -> AppSettings
fn default() -> AppSettings
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AppSettings
impl<'de> Deserialize<'de> for AppSettings
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 AppSettings
impl RefUnwindSafe for AppSettings
impl Send for AppSettings
impl Sync for AppSettings
impl Unpin for AppSettings
impl UnsafeUnpin for AppSettings
impl UnwindSafe for AppSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more