pub enum RefKind {
Free,
Method,
}Expand description
The syntactic shape of a call site.
A name alone cannot distinguish chain() from x.chain(), and conflating
them makes the resolver attribute a std or dependency method to a same-named
free function that happens to be the only one in the view (#223). Recording
the shape keeps that judgement possible at resolution time.
Variants§
Free
A plain call — foo() — or a path call such as a::b::foo().
Method
A call through a receiver whose type is unknown — x.foo(). The callee
belongs to whatever x is, which the graph does not know, so it may well
be defined outside the view entirely.
Implementations§
Source§impl RefKind
impl RefKind
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Lowercase name, matching the snake_case serde representation. Used as
the stored value in the persistent graph.
Sourcepub fn from_str_or_free(raw: &str) -> Self
pub fn from_str_or_free(raw: &str) -> Self
Parse from as_str. Anything unrecognized — including
a row written before the column existed — reads as Free, the
pre-existing behaviour.