Enum hir_def::ModuleDefId
source · pub enum ModuleDefId {
ModuleId(ModuleId),
FunctionId(FunctionId),
AdtId(AdtId),
EnumVariantId(EnumVariantId),
ConstId(ConstId),
StaticId(StaticId),
TraitId(TraitId),
TraitAliasId(TraitAliasId),
TypeAliasId(TypeAliasId),
BuiltinType(BuiltinType),
MacroId(MacroId),
}
Expand description
The defs which can be visible in the module.
Variants§
ModuleId(ModuleId)
FunctionId(FunctionId)
AdtId(AdtId)
EnumVariantId(EnumVariantId)
ConstId(ConstId)
StaticId(StaticId)
TraitId(TraitId)
TraitAliasId(TraitAliasId)
TypeAliasId(TypeAliasId)
BuiltinType(BuiltinType)
MacroId(MacroId)
Implementations§
source§impl ModuleDefId
impl ModuleDefId
sourcepub fn module(&self, db: &dyn DefDatabase) -> Option<ModuleId>
pub fn module(&self, db: &dyn DefDatabase) -> Option<ModuleId>
Returns the module containing self
(or self
, if self
is itself a module).
Returns None
if self
refers to a primitive type.
Trait Implementations§
source§impl Clone for ModuleDefId
impl Clone for ModuleDefId
source§fn clone(&self) -> ModuleDefId
fn clone(&self) -> ModuleDefId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ModuleDefId
impl Debug for ModuleDefId
source§impl From<AdtId> for ModuleDefId
impl From<AdtId> for ModuleDefId
source§fn from(it: AdtId) -> ModuleDefId
fn from(it: AdtId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<BuiltinType> for ModuleDefId
impl From<BuiltinType> for ModuleDefId
source§fn from(it: BuiltinType) -> ModuleDefId
fn from(it: BuiltinType) -> ModuleDefId
Converts to this type from the input type.
source§impl From<CallableDefId> for ModuleDefId
impl From<CallableDefId> for ModuleDefId
source§fn from(def: CallableDefId) -> ModuleDefId
fn from(def: CallableDefId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<ConstId> for ModuleDefId
impl From<ConstId> for ModuleDefId
source§fn from(it: ConstId) -> ModuleDefId
fn from(it: ConstId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<CrateRootModuleId> for ModuleDefId
impl From<CrateRootModuleId> for ModuleDefId
source§fn from(value: CrateRootModuleId) -> Self
fn from(value: CrateRootModuleId) -> Self
Converts to this type from the input type.
source§impl From<EnumId> for ModuleDefId
impl From<EnumId> for ModuleDefId
source§fn from(it: EnumId) -> ModuleDefId
fn from(it: EnumId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<EnumVariantId> for ModuleDefId
impl From<EnumVariantId> for ModuleDefId
source§fn from(it: EnumVariantId) -> ModuleDefId
fn from(it: EnumVariantId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<FunctionId> for ModuleDefId
impl From<FunctionId> for ModuleDefId
source§fn from(it: FunctionId) -> ModuleDefId
fn from(it: FunctionId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<Macro2Id> for ModuleDefId
impl From<Macro2Id> for ModuleDefId
source§fn from(it: Macro2Id) -> ModuleDefId
fn from(it: Macro2Id) -> ModuleDefId
Converts to this type from the input type.
source§impl From<MacroId> for ModuleDefId
impl From<MacroId> for ModuleDefId
source§fn from(it: MacroId) -> ModuleDefId
fn from(it: MacroId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<MacroRulesId> for ModuleDefId
impl From<MacroRulesId> for ModuleDefId
source§fn from(it: MacroRulesId) -> ModuleDefId
fn from(it: MacroRulesId) -> ModuleDefId
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 From<ProcMacroId> for ModuleDefId
impl From<ProcMacroId> for ModuleDefId
source§fn from(it: ProcMacroId) -> ModuleDefId
fn from(it: ProcMacroId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<StaticId> for ModuleDefId
impl From<StaticId> for ModuleDefId
source§fn from(it: StaticId) -> ModuleDefId
fn from(it: StaticId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<StructId> for ModuleDefId
impl From<StructId> for ModuleDefId
source§fn from(it: StructId) -> ModuleDefId
fn from(it: StructId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<TraitAliasId> for ModuleDefId
impl From<TraitAliasId> for ModuleDefId
source§fn from(it: TraitAliasId) -> ModuleDefId
fn from(it: TraitAliasId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<TraitId> for ModuleDefId
impl From<TraitId> for ModuleDefId
source§fn from(it: TraitId) -> ModuleDefId
fn from(it: TraitId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<TypeAliasId> for ModuleDefId
impl From<TypeAliasId> for ModuleDefId
source§fn from(it: TypeAliasId) -> ModuleDefId
fn from(it: TypeAliasId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<UnionId> for ModuleDefId
impl From<UnionId> for ModuleDefId
source§fn from(it: UnionId) -> ModuleDefId
fn from(it: UnionId) -> ModuleDefId
Converts to this type from the input type.
source§impl Hash for ModuleDefId
impl Hash for ModuleDefId
source§impl PartialEq for ModuleDefId
impl PartialEq for ModuleDefId
source§impl TryFrom<ModuleDefId> for AttrDefId
impl TryFrom<ModuleDefId> for AttrDefId
impl Copy for ModuleDefId
impl Eq for ModuleDefId
impl StructuralPartialEq for ModuleDefId
Auto Trait Implementations§
impl Freeze for ModuleDefId
impl RefUnwindSafe for ModuleDefId
impl Send for ModuleDefId
impl Sync for ModuleDefId
impl Unpin for ModuleDefId
impl UnwindSafe for ModuleDefId
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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