[][src]Struct pueue_lib::settings::Settings

pub struct Settings {
    pub client: Client,
    pub daemon: Daemon,
    pub shared: Shared,
}

Fields

client: Clientdaemon: Daemonshared: Shared

Implementations

impl Settings[src]

pub fn new(
    require_config: bool,
    from_file: &Option<PathBuf>
) -> Result<Settings>
[src]

This function creates a new configuration instance and populates it with default values for every option. If a local config file already exists it is parsed and overwrites the default option values. The local config is located at "~/.config/pueue.yml".

If require_config is true, an error will be thrown, if no configuration file can be found.

pub fn default_config() -> Result<Config>[src]

pub fn read(
    require_config: bool,
    from_file: &Option<PathBuf>
) -> Result<Settings>
[src]

Try to read the config file without any default values. This is done by the daemon on startup. If the file can be read without any need for defaults, we don't have to persist it afterwards.

pub fn save(&self, to_file: &Option<PathBuf>) -> Result<()>[src]

Save the current configuration as a file to the configuration path. The file is written to the main configuration directory of the respective OS.

Trait Implementations

impl Clone for Settings[src]

impl Debug for Settings[src]

impl<'de> Deserialize<'de> for Settings[src]

impl Serialize for Settings[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,