Struct ra_ap_hir::import_map::ImportMap
source · pub struct ImportMap { /* private fields */ }
Expand description
A map from publicly exported items to the path needed to import/name them from a downstream crate.
Reexports of items are taken into account, ie. if something is exported under multiple names, the one with the shortest import path will be used.
Note that all paths are relative to the containing crate’s root, so the crate name still needs
to be prepended to the ModPath
before the path is valid.
Implementations§
source§impl ImportMap
impl ImportMap
pub fn import_map_query(db: &dyn DefDatabase, krate: CrateId) -> Arc<ImportMap>
sourcepub fn path_of(&self, item: ItemInNs) -> Option<&ImportPath>
pub fn path_of(&self, item: ItemInNs) -> Option<&ImportPath>
Returns the ModPath
needed to import/mention item
, relative to this crate’s root.
pub fn import_info_for(&self, item: ItemInNs) -> Option<&ImportInfo>
Trait Implementations§
source§impl PartialEq<ImportMap> for ImportMap
impl PartialEq<ImportMap> for ImportMap
impl Eq for ImportMap
Auto Trait Implementations§
impl RefUnwindSafe for ImportMap
impl Send for ImportMap
impl Sync for ImportMap
impl Unpin for ImportMap
impl UnwindSafe for ImportMap
Blanket Implementations§
§impl<T> Cast for T
impl<T> Cast for T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.