# 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`](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html), [`Debug`](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html), [`Deserialize`](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.Deserialize.html), [`Serialize`](https://docs.rs/serde_core/1.0.228/serde_core/ser/trait.Serialize.html)

**Auto traits**: [`Send`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html), [`Sync`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html), [`Unpin`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Unpin.html), [`UnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.UnwindSafe.html), [`RefUnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.RefUnwindSafe.html)
