pub struct Crate {
pub files: Vec<SourceFile>,
pub diagnostics: Vec<LoadDiagnostic>,
pub structs: HashMap<String, StructDef>,
pub methods: HashMap<(String, String), ImplFn>,
pub functions: HashMap<String, ImplFn>,
pub qualified_structs: HashMap<String, StructDef>,
pub qualified_methods: HashMap<(String, String), ImplFn>,
pub qualified_functions: HashMap<String, ImplFn>,
pub public_reexports: Vec<PublicReexport>,
pub imports: Vec<ImportBinding>,
pub dependency_aliases: HashMap<String, String>,
/* private fields */
}Fields§
§files: Vec<SourceFile>§diagnostics: Vec<LoadDiagnostic>Filesystem and parse failures retained as structured incomplete-analysis evidence.
structs: HashMap<String, StructDef>Legacy bare-name map. When names collide, deterministic source traversal preserves the
historical last-definition-wins behavior. Use struct_candidates for new analysis.
methods: HashMap<(String, String), ImplFn>(type_name, fn_name) -> method.
functions: HashMap<String, ImplFn>Free functions by name, for fn build_encoder(vb: VarBuilder) -> .. helpers.
qualified_structs: HashMap<String, StructDef>Exact qualified identities. These maps make unambiguous lookups cheap.
qualified_methods: HashMap<(String, String), ImplFn>§qualified_functions: HashMap<String, ImplFn>§public_reexports: Vec<PublicReexport>§imports: Vec<ImportBinding>§dependency_aliases: HashMap<String, String>Rust crate identifier to Cargo package name, including dependency renames.
Implementations§
Source§impl Crate
impl Crate
Sourcepub fn all_structs(&self) -> impl Iterator<Item = &StructDef>
pub fn all_structs(&self) -> impl Iterator<Item = &StructDef>
Every struct definition, including colliding and cfg-gated alternatives.
Sourcepub fn all_methods(&self) -> impl Iterator<Item = &ImplFn>
pub fn all_methods(&self) -> impl Iterator<Item = &ImplFn>
Every inherent method, including colliding and cfg-gated alternatives.
Sourcepub fn all_functions(&self) -> impl Iterator<Item = &ImplFn>
pub fn all_functions(&self) -> impl Iterator<Item = &ImplFn>
Every free function, including colliding and cfg-gated alternatives.
pub fn field_type(&self, struct_name: &str, field: &str) -> Option<&TypeRef>
pub fn file_label(&self, span: SrcSpan) -> String
Sourcepub fn struct_candidates(&self, name: &str) -> Vec<&StructDef>
pub fn struct_candidates(&self, name: &str) -> Vec<&StructDef>
All structs matching either a bare or exact qualified name, sorted by qualified identity and source location. Unlike the legacy map, collisions are never discarded.
Sourcepub fn function_candidates(&self, name: &str) -> Vec<&ImplFn>
pub fn function_candidates(&self, name: &str) -> Vec<&ImplFn>
All free functions matching either a bare or exact qualified name.
Sourcepub fn method_candidates(&self, type_name: &str, fn_name: &str) -> Vec<&ImplFn>
pub fn method_candidates(&self, type_name: &str, fn_name: &str) -> Vec<&ImplFn>
All inherent methods matching a bare or qualified owner and a function name.
Sourcepub fn reexport_candidates(&self, name: &str) -> Vec<&PublicReexport>
pub fn reexport_candidates(&self, name: &str) -> Vec<&PublicReexport>
Public re-export leaves matching a bare binding or exact qualified binding.
Sourcepub fn resolve_import_path(
&self,
module_path: &str,
segments: &[String],
) -> Vec<String>
pub fn resolve_import_path( &self, module_path: &str, segments: &[String], ) -> Vec<String>
Resolve a source path through an explicit use binding in the containing module.
Sourcepub fn resolve_unambiguous_import_path(
&self,
segments: &[String],
) -> Vec<String>
pub fn resolve_unambiguous_import_path( &self, segments: &[String], ) -> Vec<String>
Resolve an alias when every binding of that spelling agrees on the same external target. This is used by legacy structure extraction where the current inline module is not carried through the compact arena.