pub struct Config {
agents: BTreeMap<String, Option<PathBuf>>,
default_profile: Option<ProfileName>,
repositories: BTreeMap<String, Mapping>,
}Expand description
The validated contents of config.toml.
Fields§
§agents: BTreeMap<String, Option<PathBuf>>§default_profile: Option<ProfileName>§repositories: BTreeMap<String, Mapping>Keyed by the stored key string, so iteration is ordered by it.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(root: &AppRoot) -> Result<Config>
pub fn load(root: &AppRoot) -> Result<Config>
Reads <root>/config.toml. A missing file is an empty configuration; anything invalid is an error.
Sourcepub fn agent_executable(&self, id: &str) -> Option<&Path>
pub fn agent_executable(&self, id: &str) -> Option<&Path>
The explicit executable override for an agent, if configured.
Sourcepub fn configured_agents(&self) -> impl Iterator<Item = &str>
pub fn configured_agents(&self) -> impl Iterator<Item = &str>
Every agent id that has an agents.<id> table, in sorted order.
Sourcepub fn default_profile(&self) -> Option<&ProfileName>
pub fn default_profile(&self) -> Option<&ProfileName>
The hand-edited global default (SP3 design D3).
Sourcepub fn mapping(&self, root: &Path) -> Option<&Mapping>
pub fn mapping(&self, root: &Path) -> Option<&Mapping>
The entry whose key is component-equal to root; validation guarantees there is at most one.
Sourcepub fn mappings(&self) -> impl Iterator<Item = (&Path, &Mapping)>
pub fn mappings(&self) -> impl Iterator<Item = (&Path, &Mapping)>
Every entry, ordered by the stored key string.
Sourcepub fn mappings_referencing(&self, profile: &ProfileName) -> Vec<Reference>
pub fn mappings_referencing(&self, profile: &ProfileName) -> Vec<Reference>
Every mapping field naming profile, ignoring ASCII case, so a case-only twin is never missed.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.