Struct pueue_lib::settings::Settings [−][src]
The parent settings struct.
This contains all other setting structs.
Fields
client: Clientdaemon: DaemonImplementations
impl Settings[src]
pub fn new(
require_config: bool,
from_file: &Option<PathBuf>
) -> Result<Settings>[src]
require_config: bool,
from_file: &Option<PathBuf>
) -> Result<Settings>
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
overrules the default option values.
The default 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.
This is utilized by the client, since only the daemon is allowed to touch the configuration
file.
pub fn default_config() -> Result<Config>[src]
pub fn read(
require_config: bool,
from_file: &Option<PathBuf>
) -> Result<Settings>[src]
require_config: bool,
from_file: &Option<PathBuf>
) -> Result<Settings>
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, path: &Option<PathBuf>) -> Result<()>[src]
Save the current configuration as a file to the given path.
If no path is given, the default configuration path will be used.
The file is then 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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl Serialize for Settings[src]
Auto Trait Implementations
impl RefUnwindSafe for Settings[src]
impl Send for Settings[src]
impl Sync for Settings[src]
impl Unpin for Settings[src]
impl UnwindSafe for Settings[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,