Skip to main content

Module node

Module node 

Source
Expand description

Code node representation.

A CodeNode is our abstraction over raw AST nodes. It captures the semantically meaningful parts of code: what it is, where it lives, and enough metadata to be useful for graph construction.

Structs§

CodeNode
A code entity extracted from source.

Enums§

NodeKind
The kind of code entity this node represents.
TypeRelationKind
A type relationship stored on a node until the graph builder resolves it.
Visibility
Visibility of a code entity.

Constants§

EXTENDS_REF_PREFIX
Prefix on CodeNode::references for a superclass name.
FIELD_REF_PREFIX
Prefix for a field’s type stored on a struct node: field:draft:Draft.
IMPLEMENTS_REF_PREFIX
Prefix on CodeNode::references for an implemented interface or trait.
RETURNS_REF_PREFIX
Prefix for the type a function returns, stored on its node: returns:PreparedDraft for -> Option<mac::PreparedDraft>. Stripped like a field type, with Self already replaced by the impl type.

Functions§

clean_type_name
Strips pointers, references, and generic arguments from a type name.
field_ref
Encodes a struct field’s type as a reference.
field_type_ref
Splits a field:name:Type reference into the field name and its type.
return_type_ref
The return type recorded by a returns:Type reference.
returns_ref
Encodes a function’s (stripped) return type as a reference.
type_relation_ref
Splits an extends: / implements: reference into its kind and type name.
typed_receiver
Splits a typed receiver reference into the method name and the receiver’s type path (Type or Type.field.field).
typed_receiver_ref
Encodes a method call whose receiver’s type is known from the code: .run_started@Draft, or .run_started@AppState.draft for a call on a field of a value of type AppState.