/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Persistent settings of the application.
#[derive(Debug, serde::Serialize, serde::Deserialize)] pubstruct Settings { /// Whether a crash report should be sent. #[serde(default = "default_true")] pub submit_report: bool, /// Whether the URL that was open should be included in a sent report. #[serde(default = "default_true")] pub include_url: bool, /// Whether hardware tests (such as memory tests) are enabled #[serde(default = "default_true")] pub test_hardware: bool,
}
impl Settings { /// Write the settings to the given writer. pubfn to_writer<W: std::io::Write>(&self, writer: W) -> anyhow::Result<()> {
Ok(serde_json::to_writer_pretty(writer, self)?)
}
/// Read the settings from the given reader. pubfn from_reader<R: std::io::Read>(reader: R) -> anyhow::Result<Self> {
Ok(serde_json::from_reader(reader)?)
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.