pub enum Edge {
Show 13 variants
Inherits {
from_file: String,
from_line: usize,
to: String,
to_file: String,
heuristic: bool,
},
UsesType {
from_file: String,
from_line: usize,
to: String,
to_file: String,
heuristic: bool,
},
UsesMember {
from_file: String,
from_line: usize,
to: String,
to_file: String,
heuristic: bool,
tier: Option<HeuristicTier>,
member: Option<String>,
source: Option<SemanticProvenance>,
overload_signature: Option<String>,
},
Imports {
from_file: String,
from_line: usize,
target: String,
},
Ambiguous {
origin: String,
from_file: String,
from_line: usize,
raw: String,
candidates: Vec<Candidate>,
candidate_count: usize,
},
CtorDi {
from_file: String,
from_line: usize,
iface: String,
resolution: String,
args: Option<Vec<String>>,
to: Option<String>,
candidates: Vec<Candidate>,
},
Import {
from_file: String,
from_line: usize,
target: String,
to_file: String,
via: Option<String>,
},
Call {
from_file: String,
from_line: usize,
to: String,
to_file: String,
},
JsxUse {
from_file: String,
from_line: usize,
to: String,
to_file: String,
},
Dispatch {
from_file: String,
from_line: usize,
to: String,
to_file: String,
},
Implements {
from_file: String,
from_line: usize,
to: String,
to_file: String,
member: Option<String>,
},
Overrides {
from_file: String,
from_line: usize,
to: String,
to_file: String,
member: Option<String>,
},
BusHop {
from_file: String,
from_line: usize,
message: String,
to: String,
to_file: String,
evidence: String,
},
}Expand description
Fills the slot this variant previously reserved: source: Option<SemanticProvenance>, appended after member and omitted when
empty, on the same rule.
Variants§
Inherits
Represents Inherits.
Fields
UsesType
Represents UsesType.
Fields
UsesMember
Represents UsesMember.
Fields
tier: Option<HeuristicTier>Which guess tier emitted this edge – Some exactly when
heuristic is true. Build the variant through
Edge::uses_member, which derives one from the other.
member: Option<String>The member this reference reads or calls, on precise and
heuristic edges alike. None only for a reference the extractor
recorded no member name for.
source: Option<SemanticProvenance>Some exactly on an edge a same-context compiler fact produced
(Edge::uses_member_semantic); None, and hence entirely absent
from the serialized bytes, on every edge the ladder or a
heuristic tier produced – a graph built without the semantic
layer is byte-identical to one built before this field existed.
overload_signature: Option<String>The admitted occurrence’s own overload signature (the producer’s
target.overloadSignature, e.g. "(bool)->void"), appended LAST
– present only alongside source, and only when the admitted
occurrence named one. Two same-line overloads of one member on
the SAME type resolve to the SAME to/to_file (the type-level
identity a uses-member edge already carries), so without this
field their projected edges would be byte-identical and a reader
could never tell them apart as the two distinct facts they are.
None on every syntax or heuristic edge, which keeps a graph
built without the semantic layer byte-identical to one built
before this field existed.
Imports
The value value.
Fields
Ambiguous
Represents Ambiguous.
Fields
CtorDi
Constructor-parameter DI resolution (see resolve.rs’s
resolve_ctor_param). Field order (kind, from_file, from_line,
iface, resolution, args, to, candidates) is significant –
it fixes the serialized field order.
iface is the injected type’s bare identifier; args its closed
generic arguments, present only when it has any; to the resolved
implementation’s def id, present only for ‘plain’/‘closed’/
‘open-generic’; candidates the capped, sorted tie list, present only
for ‘ambiguous’.
Fields
Import
A TS/TSX module import. Distinct from imports (C#’s
using directive, which names a NAMESPACE and resolves to no file):
target is the specifier as written and to_file the file it
resolved to. via is appended LAST and present only on a
barrel-followed edge, naming the module the source literally imported
so a reader can tell the routing table apart from the dependency.
Fields
Call
A call or new naming an imported or locally-exported
declaration.
The value value.
Fields
JsxUse
A JSX tag naming a component declaration. The value value.
Fields
Dispatch
An action creator or thunk handed to a dispatching call
(dispatch(...), ofType(...)).
The value value.
Fields
Implements
The implementation of a service interface: either a type-level fact
(member absent) read off a two-type-argument DI registration call
(services.AddScoped<IContract, Impl>()), recorded against the
IMPLEMENTATION type’s own declaring file and line – the same
convention inherits uses for its own base-list reference, applied
here to a fact the resolver derived rather than one it read directly
off that type’s own base list – or a member-level fact (member
present, naming the satisfied interface member) connecting an
implementing member to the interface member it satisfies. Never a
guess: an ambiguous name-and-arity match emits nothing rather than
picking a candidate. to/to_file name the interface.
Fields
Overrides
An override member connected to the nearest in-graph base member of
the same name and arity, matched the same way implements is: two or
more candidates at that arity emit nothing. to/to_file name the
base type declaring the overridden member; member names it.
Fields
BusHop
A message-bus hop: a publish site whose resolved message reaches a
registered consumer/handler def, both ends resolved through the
ordinary ladder in their own file’s context, never a bare-name or
same-line match. to/to_file name the consumer; message names
the resolved message def’s own id, followed by an array suffix
([] per array layer) when the identity both sides agreed on is an
array of that def rather than the def alone – never the raw text
either site wrote it as, so two same-named messages in different
namespaces, or a message and an array of it, can never be
conflated. evidence names which consumer shape the hop was
established through – see resolve/bus.rs’s own closed word list,
the one place any of its words is spelled.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn tier(&self) -> Option<HeuristicTier>
pub fn tier(&self) -> Option<HeuristicTier>
The guess tier that emitted this edge, or None on a precise one –
and on every kind that carries no tier at all, which is every kind but
uses-member.
Sourcepub fn is_heuristic(&self) -> bool
pub fn is_heuristic(&self) -> bool
Whether the edge declares itself a guess, across the three kinds that can carry the flag.
Sourcepub fn uses_member(
from_file: String,
from_line: usize,
to: String,
to_file: String,
member: Option<String>,
tier: Option<HeuristicTier>,
) -> Edge
pub fn uses_member( from_file: String, from_line: usize, to: String, to_file: String, member: Option<String>, tier: Option<HeuristicTier>, ) -> Edge
The one way to build a uses-member edge. heuristic is DERIVED from
tier rather than passed alongside it, so the two cannot disagree: a
tagged edge is always flagged, a flagged edge always names its tier,
and no emit site can grow a third state by forgetting a field.
Sourcepub fn uses_member_semantic(
from_file: String,
from_line: usize,
to: String,
to_file: String,
member: Option<String>,
provenance: SemanticProvenance,
overload_signature: Option<String>,
) -> Edge
pub fn uses_member_semantic( from_file: String, from_line: usize, to: String, to_file: String, member: Option<String>, provenance: SemanticProvenance, overload_signature: Option<String>, ) -> Edge
The one way to build a compiler-vouched uses-member edge: never
heuristic, never tiered (a confirmed compiler fact is not a guess),
always carrying source so a reader can tell it apart from every
edge the ladder or a heuristic tier produced. overload_signature
carries the admitted occurrence’s own signature, when it named one –
the exact identity that keeps two same-line overloads of one member
distinguishable once projected.
Sourcepub fn provenance(&self) -> Option<SemanticProvenance>
pub fn provenance(&self) -> Option<SemanticProvenance>
Which population produced this edge, when it names one at all –
None for every kind that is not a compiler-vouched uses-member
edge, including an ordinary precise or heuristic one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Edge
impl<'de> Deserialize<'de> for Edge
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Edge
Auto Trait Implementations§
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnsafeUnpin for Edge
impl UnwindSafe for Edge
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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