Config#

pub struct Config#

Nominal v2 configuration stored at ~/.config/nominal/config.yml.

Example format: nominal/tests/fixtures/config/config-v2-example.yml.

Implementations#

impl Config
pub fn empty() -> Self#
pub fn load_or_default() -> Result<Self>#

Load the config from the default path, or return an empty v2 config when no file exists.

pub fn load() -> Result<Self>#

Load the config from the default path (~/.config/nominal/config.yml).

pub fn load_from(path: &Path) -> Result<Self>#

Load the config from an explicit path.

pub fn get_profile(&self, name: &str) -> Option<&Profile>#
pub fn version(&self) -> u32#
pub fn profiles(&self) -> &HashMap<String, Profile>#
pub fn add_profile(&mut self, name: String, profile: Profile)#
pub fn remove_profile(&mut self, name: &str) -> Option<Profile>#
pub fn save(&self) -> Result<()>#

Save the config to the default path (~/.config/nominal/config.yml).

pub fn save_to(&self, path: &Path) -> Result<()>#

Save the config to an explicit path.

Trait implementations#

Derived: Clone, Debug, Deserialize, Serialize

Auto traits: Send, Sync, Unpin, UnwindSafe, RefUnwindSafe