pub struct ModuleExports {
pub bindings: Vec<(String, TypeScheme)>,
pub structs: Vec<StructDef>,
pub enums: Vec<EnumDef>,
pub traits: Vec<TraitDef>,
pub impls: Vec<ImplDef>,
}Expand description
The set of publicly visible items exported by a module.
Collected after type checking and used to populate the type environments of downstream modules that import from this module.
Fields§
§bindings: Vec<(String, TypeScheme)>Public function and variable bindings: (name, type_scheme).
structs: Vec<StructDef>Public struct definitions.
enums: Vec<EnumDef>Public enum definitions.
traits: Vec<TraitDef>Public trait definitions.
impls: Vec<ImplDef>All impl blocks (visibility is per-method, not per-block).
Implementations§
Source§impl ModuleExports
impl ModuleExports
Sourcepub fn from_checked(program: &Program, env: &TypeEnv) -> Self
pub fn from_checked(program: &Program, env: &TypeEnv) -> Self
Extracts public exports from a type-checked module.
Scans the AST for pub items and collects their type information
from the type environment. Must be called after type checking so
that the environment contains resolved types for all declarations.
Sourcepub fn resolve_item(&self, name: &str, result: &mut Vec<ResolvedImport>)
pub fn resolve_item(&self, name: &str, result: &mut Vec<ResolvedImport>)
Resolves all exports matching name and appends them to result.
When a struct or enum is found, any associated impl blocks from the
same module are also included so that method resolution works across
module boundaries.
Trait Implementations§
Source§impl Clone for ModuleExports
impl Clone for ModuleExports
Source§fn clone(&self) -> ModuleExports
fn clone(&self) -> ModuleExports
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more