Enum ModuleDefId
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§
§impl ModuleDefId
impl ModuleDefId
pub 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§
§impl Clone for ModuleDefId
impl Clone for ModuleDefId
§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 more§impl Debug for ModuleDefId
impl Debug for ModuleDefId
§impl From<AdtId> for ModuleDefId
impl From<AdtId> for ModuleDefId
§fn from(it: AdtId) -> ModuleDefId
fn from(it: AdtId) -> ModuleDefId
Converts to this type from the input type.
§impl From<BuiltinType> for ModuleDefId
impl From<BuiltinType> for ModuleDefId
§fn from(it: BuiltinType) -> ModuleDefId
fn from(it: BuiltinType) -> ModuleDefId
Converts to this type from the input type.
§impl From<CallableDefId> for ModuleDefId
impl From<CallableDefId> for ModuleDefId
§fn from(def: CallableDefId) -> ModuleDefId
fn from(def: CallableDefId) -> ModuleDefId
Converts to this type from the input type.
§impl From<ConstId> for ModuleDefId
impl From<ConstId> for ModuleDefId
§fn from(it: ConstId) -> ModuleDefId
fn from(it: ConstId) -> ModuleDefId
Converts to this type from the input type.
§impl From<CrateRootModuleId> for ModuleDefId
impl From<CrateRootModuleId> for ModuleDefId
§fn from(value: CrateRootModuleId) -> ModuleDefId
fn from(value: CrateRootModuleId) -> ModuleDefId
Converts to this type from the input type.
§impl From<EnumId> for ModuleDefId
impl From<EnumId> for ModuleDefId
§fn from(it: EnumId) -> ModuleDefId
fn from(it: EnumId) -> ModuleDefId
Converts to this type from the input type.
§impl From<EnumVariantId> for ModuleDefId
impl From<EnumVariantId> for ModuleDefId
§fn from(it: EnumVariantId) -> ModuleDefId
fn from(it: EnumVariantId) -> ModuleDefId
Converts to this type from the input type.
§impl From<FunctionId> for ModuleDefId
impl From<FunctionId> for ModuleDefId
§fn from(it: FunctionId) -> ModuleDefId
fn from(it: FunctionId) -> ModuleDefId
Converts to this type from the input type.
§impl From<Macro2Id> for ModuleDefId
impl From<Macro2Id> for ModuleDefId
§fn from(it: Macro2Id) -> ModuleDefId
fn from(it: Macro2Id) -> ModuleDefId
Converts to this type from the input type.
§impl From<MacroId> for ModuleDefId
impl From<MacroId> for ModuleDefId
§fn from(it: MacroId) -> ModuleDefId
fn from(it: MacroId) -> ModuleDefId
Converts to this type from the input type.
§impl From<MacroRulesId> for ModuleDefId
impl From<MacroRulesId> for ModuleDefId
§fn from(it: MacroRulesId) -> ModuleDefId
fn from(it: MacroRulesId) -> ModuleDefId
Converts to this type from the input type.
source§impl From<ModuleDef> for ModuleDefId
impl From<ModuleDef> for ModuleDefId
source§impl From<ModuleDefId> for ModuleDef
impl From<ModuleDefId> for ModuleDef
source§fn from(id: ModuleDefId) -> Self
fn from(id: ModuleDefId) -> Self
Converts to this type from the input type.
§impl From<ModuleId> for ModuleDefId
impl From<ModuleId> for ModuleDefId
§fn from(it: ModuleId) -> ModuleDefId
fn from(it: ModuleId) -> ModuleDefId
Converts to this type from the input type.
§impl From<ProcMacroId> for ModuleDefId
impl From<ProcMacroId> for ModuleDefId
§fn from(it: ProcMacroId) -> ModuleDefId
fn from(it: ProcMacroId) -> ModuleDefId
Converts to this type from the input type.
§impl From<StaticId> for ModuleDefId
impl From<StaticId> for ModuleDefId
§fn from(it: StaticId) -> ModuleDefId
fn from(it: StaticId) -> ModuleDefId
Converts to this type from the input type.
§impl From<StructId> for ModuleDefId
impl From<StructId> for ModuleDefId
§fn from(it: StructId) -> ModuleDefId
fn from(it: StructId) -> ModuleDefId
Converts to this type from the input type.
§impl From<TraitAliasId> for ModuleDefId
impl From<TraitAliasId> for ModuleDefId
§fn from(it: TraitAliasId) -> ModuleDefId
fn from(it: TraitAliasId) -> ModuleDefId
Converts to this type from the input type.
§impl From<TraitId> for ModuleDefId
impl From<TraitId> for ModuleDefId
§fn from(it: TraitId) -> ModuleDefId
fn from(it: TraitId) -> ModuleDefId
Converts to this type from the input type.
§impl From<TypeAliasId> for ModuleDefId
impl From<TypeAliasId> for ModuleDefId
§fn from(it: TypeAliasId) -> ModuleDefId
fn from(it: TypeAliasId) -> ModuleDefId
Converts to this type from the input type.
§impl From<UnionId> for ModuleDefId
impl From<UnionId> for ModuleDefId
§fn from(it: UnionId) -> ModuleDefId
fn from(it: UnionId) -> ModuleDefId
Converts to this type from the input type.
§impl Hash for ModuleDefId
impl Hash for ModuleDefId
§impl PartialEq for ModuleDefId
impl PartialEq for ModuleDefId
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
§impl<T> Cast for T
impl<T> Cast for T
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