pub struct Config {
pub accounts: Vec<AccountConfig>,
pub ui: UiConfig,
}Fields§
§accounts: Vec<AccountConfig>§ui: UiConfigImplementations§
Source§impl Config
impl Config
pub fn parse(text: &str) -> Result<Config, ConfigError>
pub fn load(path: &Path) -> Result<Config, ConfigError>
Sourcepub fn save(&self, path: &Path) -> Result<(), ConfigError>
pub fn save(&self, path: &Path) -> Result<(), ConfigError>
Writes the accounts and [ui] into the file in place: comments, untouched keys and their order stay, and a
setting the file leaves out is only written once it differs from its default.
pub fn account(&self, name: &str) -> Option<&AccountConfig>
pub fn validate(&self) -> Result<(), ConfigError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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