pub enum FromScope {
Function,
Module,
}Expand description
What a Reference’s from names.
Variants§
Function
A function: a declaration, a method, or a function bound to a name. The only kind before #268, and the default — so a slice written before it deserializes to exactly what it meant.
Module
A module-level binding that is not a function — const schema = z.object({..}), a tRPC handler keyed in a router object. The call sits
in that binding’s initializer at module level (#268).
Deliberately over-inclusive in the same way RefKind::Value is: a
module-level const rows = items.map(..) attributes its lambda’s calls
to rows. At module level the alternative was no attribution at all,
and this field is what lets a consumer filter rather than guess.
Implementations§
Source§impl FromScope
impl FromScope
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Whether this is the default, Function scope.
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Lowercase name, matching the snake_case serde representation. The
stored value in the persistent graph.
Sourcepub fn from_str_or_function(raw: &str) -> Self
pub fn from_str_or_function(raw: &str) -> Self
Parse from as_str. Anything unrecognized —
including a row written before the column existed — reads as
Function, the pre-existing behaviour.