Skip to main content

Module load

Module load 

Source
Expand description

Crate loading and the symbol table.

We deliberately do not attempt real type inference. The measured property that makes this sound for candle model code is that such code is monomorphic and uses inherent fn methods on concrete structs — no trait objects, no generic modules. So a crate-local struct -> field -> type table plus type -> methods is enough to resolve SelfAttention::new(cfg, vb.pp("self_attn")) to a body.

Where that assumption breaks we record a diagnostic instead of guessing.

Structs§

Crate
FieldDef
ImplFn
An inherent method on a concrete type.
ImportBinding
LoadDiagnostic
PublicReexport
A public use leaf. Keeping the syntactic target is useful even when that target cannot be resolved without Cargo/rustc name resolution.
SourceFile
StructDef
TypeRef
A parsed field type, decomposed just enough to see through the containers candle model code actually uses.

Enums§

Container

Functions§

load
Parse every .rs file under root, skipping target/ and hidden directories.
load_from_roots
Load only Rust modules reachable from the selected Cargo crate roots.
span_of
type_base_name
Last path segment of a type, e.g. nn::Linear -> Linear.
type_ref
Peel Vec<T>, Option<T> and Box<T> down to the named type inside.
type_text