pub struct Analyzer {
pub config: Config,
pub parser: BashParser,
pub remote: bool,
pub working_directory: PathBuf,
pub verbose: bool,
/* private fields */
}Expand description
The core analysis engine: parses a command and produces a safety verdict.
Fields§
§config: Config§parser: BashParser§remote: bool§working_directory: PathBuf§verbose: boolImplementations§
Source§impl Analyzer
impl Analyzer
Sourcepub fn from_env(config: Config, env: Environment) -> Result<Self, RippyError>
pub fn from_env(config: Config, env: Environment) -> Result<Self, RippyError>
Create a new analyzer from an Environment struct.
This is the preferred constructor — it takes all external dependencies as an explicit struct, making tests deterministic without env-var hacks.
§Errors
Returns RippyError::Parse if the bash parser cannot be initialized.
Sourcepub fn new(
config: Config,
remote: bool,
working_directory: PathBuf,
verbose: bool,
) -> Result<Self, RippyError>
pub fn new( config: Config, remote: bool, working_directory: PathBuf, verbose: bool, ) -> Result<Self, RippyError>
Create a new analyzer using the real process environment for variable lookups.
Convenience wrapper around Analyzer::from_env that reads $HOME
and process env vars automatically.
§Errors
Returns RippyError::Parse if the bash parser cannot be initialized.
Sourcepub fn new_with_var_lookup(
config: Config,
remote: bool,
working_directory: PathBuf,
verbose: bool,
var_lookup: Box<dyn VarLookup>,
) -> Result<Self, RippyError>
pub fn new_with_var_lookup( config: Config, remote: bool, working_directory: PathBuf, verbose: bool, var_lookup: Box<dyn VarLookup>, ) -> Result<Self, RippyError>
Create a new analyzer with a custom variable lookup (used by tests
to inject deterministic env values via MockLookup).
§Errors
Returns RippyError::Parse if the bash parser cannot be initialized.
Auto Trait Implementations§
impl Freeze for Analyzer
impl !RefUnwindSafe for Analyzer
impl Send for Analyzer
impl Sync for Analyzer
impl Unpin for Analyzer
impl UnsafeUnpin for Analyzer
impl !UnwindSafe for Analyzer
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.