pub enum ModuleDef {
Module(Module),
Function(Function),
Adt(Adt),
Variant(Variant),
Const(Const),
Static(Static),
Trait(Trait),
TraitAlias(TraitAlias),
TypeAlias(TypeAlias),
BuiltinType(BuiltinType),
Macro(Macro),
}
Expand description
The defs which can be visible in the module.
Variants§
Module(Module)
Function(Function)
Adt(Adt)
Variant(Variant)
Const(Const)
Static(Static)
Trait(Trait)
TraitAlias(TraitAlias)
TypeAlias(TypeAlias)
BuiltinType(BuiltinType)
Macro(Macro)
Implementations§
source§impl ModuleDef
impl ModuleDef
pub fn module(self, db: &dyn HirDatabase) -> Option<Module>
pub fn canonical_path(&self, db: &dyn HirDatabase) -> Option<String>
pub fn canonical_module_path( &self, db: &dyn HirDatabase ) -> Option<impl Iterator<Item = Module>>
pub fn name(self, db: &dyn HirDatabase) -> Option<Name>
pub fn diagnostics( self, db: &dyn HirDatabase, style_lints: bool ) -> Vec<AnyDiagnostic>
pub fn as_def_with_body(self) -> Option<DefWithBody>
pub fn attrs(&self, db: &dyn HirDatabase) -> Option<AttrsWithOwner>
Trait Implementations§
source§impl AsAssocItem for ModuleDef
impl AsAssocItem for ModuleDef
fn as_assoc_item(self, db: &dyn HirDatabase) -> Option<AssocItem>
source§impl From<BuiltinType> for ModuleDef
impl From<BuiltinType> for ModuleDef
source§fn from(it: BuiltinType) -> ModuleDef
fn from(it: BuiltinType) -> ModuleDef
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.
source§impl From<TraitAlias> for ModuleDef
impl From<TraitAlias> for ModuleDef
source§fn from(it: TraitAlias) -> ModuleDef
fn from(it: TraitAlias) -> ModuleDef
Converts to this type from the input type.
source§impl From<VariantDef> for ModuleDef
impl From<VariantDef> for ModuleDef
source§fn from(var: VariantDef) -> Self
fn from(var: VariantDef) -> Self
Converts to this type from the input type.
source§impl HasVisibility for ModuleDef
impl HasVisibility for ModuleDef
fn visibility(&self, db: &dyn HirDatabase) -> Visibility
fn is_visible_from(&self, db: &dyn HirDatabase, module: Module) -> bool
source§impl PartialEq for ModuleDef
impl PartialEq for ModuleDef
impl Copy for ModuleDef
impl Eq for ModuleDef
impl StructuralPartialEq for ModuleDef
Auto Trait Implementations§
impl Freeze for ModuleDef
impl RefUnwindSafe for ModuleDef
impl Send for ModuleDef
impl Sync for ModuleDef
impl Unpin for ModuleDef
impl UnwindSafe for ModuleDef
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> Cast for T
impl<T> Cast for T
source§fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
Cast a value to type
U
using CastTo
.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.