pub struct ProfileStore { /* private fields */ }Expand description
Discovers and loads profiles from filesystem directories.
Search order:
- Project profiles:
.orcs/profiles/ - Global profiles:
~/.orcs/profiles/
Project profiles take precedence over global profiles with the same name.
Implementations§
Source§impl ProfileStore
impl ProfileStore
Sourcepub fn new(project_root: Option<&Path>) -> Self
pub fn new(project_root: Option<&Path>) -> Self
Creates a new store with default search dirs.
~/.orcs/profiles/(global)- Optionally:
.orcs/profiles/(project, if project_root given)
Sourcepub fn list(&self) -> Vec<ProfileEntry>
pub fn list(&self) -> Vec<ProfileEntry>
Lists available profiles (name + description + path).
Scans all search directories for .toml files.
Deduplicates by name (first found wins = highest priority).
Sourcepub fn load(&self, name: &str) -> Result<ProfileDef, ConfigError>
pub fn load(&self, name: &str) -> Result<ProfileDef, ConfigError>
Loads a profile by name.
Searches all dirs in priority order for {name}.toml.
§Errors
Returns ConfigError if profile not found or parse fails.
Sourcepub fn load_from_path(path: &Path) -> Result<ProfileDef, ConfigError>
pub fn load_from_path(path: &Path) -> Result<ProfileDef, ConfigError>
Trait Implementations§
Source§impl Clone for ProfileStore
impl Clone for ProfileStore
Source§fn clone(&self) -> ProfileStore
fn clone(&self) -> ProfileStore
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 moreAuto Trait Implementations§
impl Freeze for ProfileStore
impl RefUnwindSafe for ProfileStore
impl Send for ProfileStore
impl Sync for ProfileStore
impl Unpin for ProfileStore
impl UnsafeUnpin for ProfileStore
impl UnwindSafe for ProfileStore
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