Skip to main content

ImpactArgs

Struct ImpactArgs 

Source
pub struct ImpactArgs {
Show 16 fields pub test: bool, pub format: Format, pub since: String, pub manifest_dir: Option<PathBuf>, pub confidence_min: f64, pub fail_on: Option<FailOn>, pub semver_checks: bool, pub rust_analyzer: bool, pub budget: usize, pub context: bool, pub features: Vec<String>, pub all_features: bool, pub no_default_features: bool, pub macro_expand: bool, pub feature_powerset: bool, pub cache: bool,
}
Expand description

Command-line arguments for cargo impact.

Fields§

§test: bool

Emit a cargo-nextest filter expression instead of the structured report. Overrides --format.

§format: Format

Output format for the structured report.

§since: String

Git ref to diff against. Uncommitted (staged + unstaged) changes are always included regardless of this value.

§manifest_dir: Option<PathBuf>

Repository root. Defaults to the current working directory.

§confidence_min: f64

Hide findings whose confidence is below this threshold (0.0–1.0).

§fail_on: Option<FailOn>

Exit non-zero if any finding at this severity class or above is emitted. Useful for CI gating. high only gates on high-severity findings; medium gates on medium+high; low gates on any non-unknown.

§semver_checks: bool

Opt in to public-API breakage detection via cargo-semver-checks. Off by default because the underlying tool builds rustdoc JSON twice and typically takes 10–30 seconds. Requires cargo-semver-checks on PATH; if absent, a stderr warning is printed and the check is skipped (non-fatal).

§rust_analyzer: bool

Opt in to rust-analyzer-backed analysis for Proven-tier findings. v0.3-alpha scaffolding: the flag is wired through and the tool’s presence on PATH is detected, but the LSP integration itself is a stub that returns no findings. Full implementation lands in a follow-up v0.3 release (see README §11).

§budget: usize

Character budget for the rendered output — useful for keeping --format markdown inside an AI agent’s context window. 0 (the default) means unlimited. Only affects the markdown renderer; text is for human terminals, JSON is for programmatic consumers who can filter themselves. Chars ≈ ¼ token for mainstream models (claude, gpt-4-ish tokenizers), so --budget=32000 fits ≈ 8k tokens. The header + summary always render even if they alone exceed the budget; severity sections and the checklist are truncated in priority order (severity → tier → confidence) with a footer noting how many findings were dropped.

§context: bool

Emit a newline-delimited list of files implicated by the blast radius (one repo-relative path per line) instead of the normal report. Pipes directly into cargo-context’s --files-from - flag for the canonical handoff: cargo impact --context | cargo context --files-from -. Also consumable by any file-list tool (xargs cat, grep -l, etc.). Unique paths only. Overrides --format and --test.

§features: Vec<String>

Activate these Cargo features for cfg evaluation. Accepts a comma-separated list and/or repeated flags. Takes precedence over the manifest’s default set and is unioned with it unless --no-default-features is also supplied. Transitively expands feature dependencies per the manifest’s [features] table.

§all_features: bool

Activate every feature declared in the manifest’s [features] table. Mutually useful with --no-default-features when you want to audit the full surface instead of just the default view.

§no_default_features: bool

Skip the manifest’s default feature list. Mirrors cargo’s --no-default-features.

§macro_expand: bool

Opt in to cargo-expand-backed trait-impl detection for impls synthesized by derive and attribute macros (serde, tokio, clap, thiserror, …). Requires cargo-expand on PATH; install via cargo install cargo-expand. When absent or expansion fails, a stderr warning is printed and the check is skipped (non-fatal). Off by default because the expansion pass adds 10-60s depending on crate size.

§feature_powerset: bool

Run analysis across a depth-1 feature powerset (baseline + --no-default-features + --all-features) and surface findings that the baseline view missed. Intended for CI — triples analyzer cost so off by default. Findings visible only under a non-baseline set are annotated in evidence with the feature set that revealed them. A full feature powerset (O(2^N) over N features) is out of scope; the depth-1 view catches the usual feature-gated blast radius (std/no_std, sync/async, feature = “foo” paths) without combinatorial blow-up.

§cache: bool

Enable content-hash caching for incremental analysis. Caches top-level symbol extraction by file content hash, avoiding re-parsing unchanged fallback files across runs. Cache lives at target/cargo-impact/cache/.

Trait Implementations§

Source§

impl Args for ImpactArgs

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for ImpactArgs

Source§

fn clone(&self) -> ImpactArgs

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandFactory for ImpactArgs

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for ImpactArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for ImpactArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for ImpactArgs

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.