pub struct ModelHabitat { /* private fields */ }Expand description
The machine’s model locations, resolved from home and environment.
Implementations§
Source§impl ModelHabitat
impl ModelHabitat
Sourcepub fn new(
home: impl Into<PathBuf>,
environment: HashMap<String, String>,
) -> Self
pub fn new( home: impl Into<PathBuf>, environment: HashMap<String, String>, ) -> Self
A habitat rooted at home with the given environment.
Sourcepub fn detect() -> Self
pub fn detect() -> Self
A habitat detected from the process: $HOME and the current
environment, less any variable this process cannot read as text.
std::env::vars panics on one of those, and a store path is never
among them.
Sourcepub fn roots(&self, settings: &ModelsSettings) -> Vec<(SourceKind, PathBuf)>
pub fn roots(&self, settings: &ModelsSettings) -> Vec<(SourceKind, PathBuf)>
Every (kind, root) this habitat would scan, in order.
Sourcepub fn scanners(
&self,
kinds: Option<&[SourceKind]>,
settings: &ModelsSettings,
) -> Vec<Box<dyn StoreScanner>>
pub fn scanners( &self, kinds: Option<&[SourceKind]>, settings: &ModelsSettings, ) -> Vec<Box<dyn StoreScanner>>
The scanners to run. If kinds is given, only scanners producing at least
one of those kinds are included; None includes all.
Trait Implementations§
Source§impl Clone for ModelHabitat
impl Clone for ModelHabitat
Source§fn clone(&self) -> ModelHabitat
fn clone(&self) -> ModelHabitat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ModelHabitat
impl RefUnwindSafe for ModelHabitat
impl Send for ModelHabitat
impl Sync for ModelHabitat
impl Unpin for ModelHabitat
impl UnsafeUnpin for ModelHabitat
impl UnwindSafe for ModelHabitat
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