Struct ra_ap_hir_def::ModuleId
source · pub struct ModuleId {
pub local_id: LocalModuleId,
/* private fields */
}
Fields§
§local_id: LocalModuleId
The module’s ID in its originating DefMap
.
Implementations§
source§impl ModuleId
impl ModuleId
pub fn def_map(self, db: &dyn DefDatabase) -> Arc<DefMap>
pub fn crate_def_map(self, db: &dyn DefDatabase) -> Arc<DefMap>
pub fn krate(self) -> CrateId
pub fn name(self, db: &dyn DefDatabase) -> Option<Name>
sourcepub fn containing_module(self, db: &dyn DefDatabase) -> Option<ModuleId>
pub fn containing_module(self, db: &dyn DefDatabase) -> Option<ModuleId>
Returns the module containing self
, either the parent mod
, or the module (or block) containing
the block, if self
corresponds to a block expression.
pub fn containing_block(self) -> Option<BlockId>
pub fn is_block_module(self) -> bool
Trait Implementations§
source§impl ChildBySource for ModuleId
impl ChildBySource for ModuleId
fn child_by_source_to( &self, db: &dyn DefDatabase, res: &mut DynMap, file_id: HirFileId )
fn child_by_source(&self, db: &dyn DefDatabase, file_id: HirFileId) -> DynMap
source§impl From<CrateRootModuleId> for ModuleId
impl From<CrateRootModuleId> for ModuleId
source§fn from(_: CrateRootModuleId) -> Self
fn from(_: CrateRootModuleId) -> Self
Converts to this type from the input type.
source§impl From<ModuleId> for ItemContainerId
impl From<ModuleId> for ItemContainerId
source§fn from(it: ModuleId) -> ItemContainerId
fn from(it: ModuleId) -> ItemContainerId
Converts to this type from the input type.
source§impl From<ModuleId> for ModuleDefId
impl From<ModuleId> for ModuleDefId
source§fn from(it: ModuleId) -> ModuleDefId
fn from(it: ModuleId) -> ModuleDefId
Converts to this type from the input type.
source§impl HasResolver for ModuleId
impl HasResolver for ModuleId
source§fn resolver(self, db: &dyn DefDatabase) -> Resolver
fn resolver(self, db: &dyn DefDatabase) -> Resolver
Builds a resolver for type references inside this def.
source§impl Ord for ModuleId
impl Ord for ModuleId
source§impl PartialEq<CrateRootModuleId> for ModuleId
impl PartialEq<CrateRootModuleId> for ModuleId
source§fn eq(&self, other: &CrateRootModuleId) -> bool
fn eq(&self, other: &CrateRootModuleId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<ModuleId> for CrateRootModuleId
impl PartialEq<ModuleId> for CrateRootModuleId
source§impl PartialEq for ModuleId
impl PartialEq for ModuleId
source§impl PartialOrd for ModuleId
impl PartialOrd for ModuleId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<ModuleId> for CrateRootModuleId
impl TryFrom<ModuleId> for CrateRootModuleId
impl Copy for ModuleId
impl Eq for ModuleId
impl StructuralPartialEq for ModuleId
Auto Trait Implementations§
impl Freeze for ModuleId
impl RefUnwindSafe for ModuleId
impl Send for ModuleId
impl Sync for ModuleId
impl Unpin for ModuleId
impl UnwindSafe for ModuleId
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more