pub struct Settings {
pub server_url: String,
pub test_size_mb: u64,
pub timeout_seconds: u64,
pub detail_level: DetailLevel,
pub animations: bool,
pub auto_run: bool,
pub max_history: usize,
}Expand description
Persistent user preferences shared across runs.
#[serde(default)] makes the on-disk format forward/backward compatible:
unknown fields are ignored and missing fields fall back to Default.
Fields§
§server_url: StringPreferred test server URL.
test_size_mb: u64Test payload size in megabytes.
timeout_seconds: u64Per-test timeout in seconds.
detail_level: DetailLevelOutput detail level.
animations: boolWhether animations/live charts are enabled.
auto_run: boolAutomatically run a test when the app launches.
max_history: usizeHow many past runs to show in history views.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn config_path() -> Result<PathBuf, Box<dyn Error>>
pub fn config_path() -> Result<PathBuf, Box<dyn Error>>
Path to the settings file, creating the parent directory if needed.
Sourcepub fn load() -> Self
pub fn load() -> Self
Load settings from disk, falling back to defaults on any error (missing file, partial JSON, parse failure).
Sourcepub fn save(&self) -> Result<(), Box<dyn Error>>
pub fn save(&self) -> Result<(), Box<dyn Error>>
Persist settings to disk as pretty-printed JSON.
Sourcepub fn to_config(&self) -> TestConfig
pub fn to_config(&self) -> TestConfig
Build a TestConfig from these settings.
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
impl StructuralPartialEq for Settings
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