pub struct TypeAggregator { /* private fields */ }Expand description
Used to aggregate types defined in different Types collections.
A type aggregator can be used to merge compatible definitions of the same type into a single supertype definition stored within the aggregator; this is useful for imports that are shared across different instantiation arguments.
It works by first recursively remapping a type from a foreign Types
collection into its own Types collection; any further attempt
to aggregate the type causes a merge of type definitions provided
they are compatible.
Implementations§
Source§impl TypeAggregator
impl TypeAggregator
Sourcepub fn imports(&self) -> impl Iterator<Item = (&str, ItemKind)>
pub fn imports(&self) -> impl Iterator<Item = (&str, ItemKind)>
Iterates the imported types in the aggregator.
Sourcepub fn canonical_import_name<'a>(&'a self, name: &'a str) -> &'a str
pub fn canonical_import_name<'a>(&'a self, name: &'a str) -> &'a str
Returns the canonical (highest semver version) import name for the given name.
If the name was superseded by a higher semver-compatible version, the canonical name is returned. Otherwise, the name itself is returned.