pub enum Why {
Show 14 variants
Inherits,
UsesType,
UsesMemberPrecise,
UsesMemberExt,
UsesMemberGuess,
CtorDi,
Imports,
Declaration,
TestAttribute,
TestProject,
Implements,
Overrides,
ImportedEdge,
BusHop,
}Expand description
One of the words a hit row’s why field names.
Variants§
Inherits
A base-list (inherits) edge.
UsesType
A uses-type edge.
UsesMemberPrecise
A precise (non-heuristic) uses-member edge.
UsesMemberExt
A uses-member edge the extension-method tier guessed.
UsesMemberGuess
A uses-member edge the scored-guess tier guessed (or one that
carries no tier at all – see row_tier’s own rule for that case).
CtorDi
A constructor-injection (ctor-di) edge.
Imports
A C# using directive (an imports edge).
Declaration
The def’s own declaration span – read only, never an edge at all.
TestAttribute
A tests row earned because a def declared in the file carries a
test-runner attribute.
TestProject
A tests row earned because the project model places the file’s
unit in a project marked test, with no attributed def of its own.
Implements
An implements edge: a service registration’s implementation type, or
a member satisfying an interface member. Appended after the words that
pre-date the edge kind, so no existing word moves.
Overrides
An overrides edge: a member overriding the nearest in-graph base
member of the same name and arity.
ImportedEdge
An impact row reached only through an imported cross-repo edge –
never folded against the five kinds above, since a foreign file is
never also reached by one of this graph’s own edges. The weakest
evidence this vocabulary names, below uses-member-guess: a foreign,
producer-asserted fact never outranks anything this crate resolved
for itself.
BusHop
A bus-hop edge: a publish site’s resolved message reaching a
registered consumer/handler def. Appended after imported-edge, the
fourteenth and newest word, so no existing word moves.
Implementations§
Source§impl Why
impl Why
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
The exact --json word for this value.
Examples found in repository?
48fn answer(index: &query::GraphIndex<'_>, seed: &str, cap: usize) -> Result<Value, String> {
49 let query::ImpactResult::Resolved(model) = query::build_impact_model(
50 index,
51 seed,
52 query::DEFAULT_HOPS,
53 cap,
54 true,
55 query::DEFAULT_IFACE_MAX_FANIN,
56 query::DEFAULT_HUB_MAX_INDEGREE,
57 ) else {
58 return Err(format!("seed is not uniquely resolved: {seed}"));
59 };
60 Ok(json!({
61 "rows": model.rows.iter().map(|row| json!({
62 "file": row.file, "hop": row.hop, "heuristic": row.heuristic,
63 "why": row.why.as_str(), "from_lines": row.from_lines,
64 "symbols": row.top_symbols, "infra": row.infra,
65 })).collect::<Vec<_>>(),
66 "dropped": model.dropped,
67 "total_affected": model.total_affected,
68 "heuristic_affected": model.heuristic_affected,
69 "tests_affected": model.tests_affected,
70 "braked_interfaces": model.braked.iter().map(|b| json!({
71 "iface": b.iface, "fanin": b.fanin,
72 })).collect::<Vec<_>>(),
73 "braked_files": model.braked_files.iter().map(|b| json!({
74 "file": b.file, "indegree": b.indegree,
75 })).collect::<Vec<_>>(),
76 }))
77}Trait Implementations§
impl Copy for Why
impl Eq for Why
impl StructuralPartialEq for Why
Auto Trait Implementations§
impl Freeze for Why
impl RefUnwindSafe for Why
impl Send for Why
impl Sync for Why
impl Unpin for Why
impl UnsafeUnpin for Why
impl UnwindSafe for Why
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more