pub struct Registry {
pub harnesses: Vec<HarnessProfile>,
pub runtimes: Vec<RuntimeProfile>,
}Expand description
All known profiles: the built-ins, overridden or extended by user profile dirs.
Fields§
§harnesses: Vec<HarnessProfile>§runtimes: Vec<RuntimeProfile>Implementations§
Source§impl Registry
impl Registry
Sourcepub fn load(ctx: &Ctx) -> Result<Registry, Error>
pub fn load(ctx: &Ctx) -> Result<Registry, Error>
Built-ins plus every profile found in profile_dirs.
Sourcepub fn extend_from_dir(&mut self, dir: &Path) -> Result<(), Error>
pub fn extend_from_dir(&mut self, dir: &Path) -> Result<(), Error>
Add (or replace by id) the profiles in dir/harnesses and dir/runtimes.
Sourcepub fn load_for(
ctx: &Ctx,
manifest: Option<&Manifest>,
) -> Result<Registry, Error>
pub fn load_for( ctx: &Ctx, manifest: Option<&Manifest>, ) -> Result<Registry, Error>
Built-ins, profile dirs, then the manifest’s own [harnesses.<id>] tables.
Sourcepub fn add_project_harnesses(&mut self, m: &Manifest) -> Result<(), Error>
pub fn add_project_harnesses(&mut self, m: &Manifest) -> Result<(), Error>
Register a manifest’s [harnesses.<id>] tables as custom profiles. A
table with framework = "<id>" inherits that framework’s packages.
pub fn harness(&self, name: &str) -> Option<&HarnessProfile>
pub fn runtime(&self, name: &str) -> Option<&RuntimeProfile>
Sourcepub fn require_harness(&self, name: &str) -> Result<&HarnessProfile, Error>
pub fn require_harness(&self, name: &str) -> Result<&HarnessProfile, Error>
Look a harness up by id or alias, with a helpful error listing what exists.
Sourcepub fn active(&self, ctx: &Ctx) -> Option<&HarnessProfile>
pub fn active(&self, ctx: &Ctx) -> Option<&HarnessProfile>
The harness this process is running inside, if any.
Sourcepub fn select(
&self,
explicit: Option<&str>,
manifest_target: Option<&str>,
ctx: &Ctx,
) -> Result<Selection, Error>
pub fn select( &self, explicit: Option<&str>, manifest_target: Option<&str>, ctx: &Ctx, ) -> Result<Selection, Error>
Pick the harness a command should target, in precedence order: an explicit
name, HLOCK_HARNESS, the manifest’s [target] harness, the harness this
process runs inside, then the only installed harness.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
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