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, edition: Edition, ) -> 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>
sourcepub fn as_self_generic_def(self) -> Option<GenericDef>
pub fn as_self_generic_def(self) -> Option<GenericDef>
Returns only defs that have generics from themselves, not their parent.
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
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
§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