pub struct ResolvedModule {
pub name: String,
pub functions: BTreeMap<String, FnEntry>,
pub methods: BTreeMap<(String, String), FnEntry>,
pub structs: BTreeMap<String, StructEntry>,
pub enums: BTreeMap<String, EnumEntry>,
pub traits: BTreeMap<String, TraitEntry>,
pub conformances: BTreeMap<(String, String), Conformance>,
pub aliases: BTreeMap<String, AliasEntry>,
pub host_uses: BTreeSet<String>,
pub host_items: BTreeMap<String, String>,
pub imports: BTreeMap<String, String>,
pub module_imports: BTreeMap<String, String>,
}Expand description
Everything one module declares.
Fields§
§name: String§functions: BTreeMap<String, FnEntry>Free functions, keyed by name.
methods: BTreeMap<(String, String), FnEntry>Methods and associated functions, keyed by (type name, function name).
structs: BTreeMap<String, StructEntry>§enums: BTreeMap<String, EnumEntry>§traits: BTreeMap<String, TraitEntry>§conformances: BTreeMap<(String, String), Conformance>Every declared conformance, keyed by (trait name, type name).
aliases: BTreeMap<String, AliasEntry>§host_uses: BTreeSet<String>Host modules named by use, such as console from use console.println.
host_items: BTreeMap<String, String>Names imported unqualified by use, such as println -> console.
imports: BTreeMap<String, String>Declarations imported from another module of the package, mapping the
name they are visible under — the use path’s last segment, which is
the declaration’s own name — to the module that declares them.
Only exported declarations ever appear here; a use naming a
module-private one is rejected.
module_imports: BTreeMap<String, String>Modules imported whole, mapping the name they are visible under — the
use path’s last segment — to the full module name, so their exports
can be reached qualified as booking.createBooking.
Implementations§
Source§impl ResolvedModule
impl ResolvedModule
Sourcepub fn owner_of<'a>(&'a self, name: &str) -> Option<&'a str>
pub fn owner_of<'a>(&'a self, name: &str) -> Option<&'a str>
The module that declares name as this module sees it: itself when it
declares name, and the module name was imported from otherwise.
A local declaration wins, which is only reachable when a conflicting
import was already reported: resolve refuses a use that binds a
name this module also declares.
Sourcepub fn exported(&self, name: &str) -> Option<bool>
pub fn exported(&self, name: &str) -> Option<bool>
Whether this module’s declaration of name is exported, or None
when it declares no name.
A method is not a declaration in this sense: it is reached through its type, so the type’s visibility is what governs it.
Sourcepub fn dependencies(&self) -> BTreeSet<&str>
pub fn dependencies(&self) -> BTreeSet<&str>
Every module this one imports from, whether by declaration or whole.