pub struct Environment {
pub home: Option<PathBuf>,
pub working_directory: PathBuf,
pub var_lookup: Box<dyn VarLookup>,
pub remote: bool,
pub verbose: bool,
}Expand description
External environment dependencies for the analysis pipeline.
Groups all values that come from the OS environment so they can be
overridden in tests without manipulating env vars. Production code
creates this via Environment::from_system; tests use the builder
methods to inject specific values.
Fields§
§home: Option<PathBuf>Home directory ($HOME). Used for ~/.rippy/config, ~/.claude/settings.
None skips all home-based lookups.
working_directory: PathBufWorking directory for the analysis (usually std::env::current_dir()).
var_lookup: Box<dyn VarLookup>Variable lookup for static expansion resolution.
Defaults to EnvLookup (real std::env::var).
remote: boolWhether the command originates from a remote context (e.g. docker exec).
verbose: boolEmit tracing to stderr.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn from_system(
working_directory: PathBuf,
remote: bool,
verbose: bool,
) -> Self
pub fn from_system( working_directory: PathBuf, remote: bool, verbose: bool, ) -> Self
Build from the real system environment.
Sourcepub fn for_test(working_directory: PathBuf) -> Self
pub fn for_test(working_directory: PathBuf) -> Self
Build an isolated environment for tests: no home directory, no remote, no verbose, real env-var lookup for variable resolution.
Sourcepub fn with_home(self, home: Option<PathBuf>) -> Self
pub fn with_home(self, home: Option<PathBuf>) -> Self
Override the home directory (builder pattern).
Sourcepub fn with_var_lookup(self, var_lookup: Box<dyn VarLookup>) -> Self
pub fn with_var_lookup(self, var_lookup: Box<dyn VarLookup>) -> Self
Override the variable lookup (builder pattern).
Auto Trait Implementations§
impl Freeze for Environment
impl !RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnsafeUnpin for Environment
impl !UnwindSafe for Environment
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.