pub struct ProfileRegistry {
pub profiles: BTreeMap<String, ProfileEntry>,
}Expand description
The ~/.roboticus/profiles.toml file structure.
Fields§
§profiles: BTreeMap<String, ProfileEntry>Implementations§
Source§impl ProfileRegistry
impl ProfileRegistry
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load from ~/.roboticus/profiles.toml, creating a default registry if the file is
absent. A missing file is not an error — it simply means the user has not yet created
any named profiles; we treat the ~/.roboticus/ root as the active default profile.
Sourcepub fn active_profile(&self) -> Option<(&str, &ProfileEntry)>
pub fn active_profile(&self) -> Option<(&str, &ProfileEntry)>
Return the active profile as (id, entry), or None if no profile is marked active.
Sourcepub fn resolve_config_dir(&self, profile_id: &str) -> Result<PathBuf>
pub fn resolve_config_dir(&self, profile_id: &str) -> Result<PathBuf>
Resolve the configuration directory for the given profile ID.
"default"(or any profile whosepathis empty) →~/.roboticus/- Any other profile →
~/.roboticus/<entry.path>/
Sourcepub fn list(&self) -> Vec<(String, ProfileEntry)>
pub fn list(&self) -> Vec<(String, ProfileEntry)>
List all profiles as (id, entry) pairs in key order.
Sourcepub fn ensure_profile_dir(&self, profile_id: &str) -> Result<PathBuf>
pub fn ensure_profile_dir(&self, profile_id: &str) -> Result<PathBuf>
Ensure the profile directory (and standard sub-directories) exist on disk.
Trait Implementations§
Source§impl Clone for ProfileRegistry
impl Clone for ProfileRegistry
Source§fn clone(&self) -> ProfileRegistry
fn clone(&self) -> ProfileRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProfileRegistry
impl Debug for ProfileRegistry
Source§impl Default for ProfileRegistry
impl Default for ProfileRegistry
Source§fn default() -> ProfileRegistry
fn default() -> ProfileRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProfileRegistry
impl<'de> Deserialize<'de> for ProfileRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProfileRegistry
impl RefUnwindSafe for ProfileRegistry
impl Send for ProfileRegistry
impl Sync for ProfileRegistry
impl Unpin for ProfileRegistry
impl UnsafeUnpin for ProfileRegistry
impl UnwindSafe for ProfileRegistry
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