pub enum ItemInNs {
Types(ModuleDef),
Values(ModuleDef),
Macros(Macro),
}
Variants§
Implementations§
source§impl ItemInNs
impl ItemInNs
pub fn as_module_def(self) -> Option<ModuleDef>
sourcepub fn krate(&self, db: &dyn HirDatabase) -> Option<Crate>
pub fn krate(&self, db: &dyn HirDatabase) -> Option<Crate>
Returns the crate defining this item (or None
if self
is built-in).
pub fn attrs(&self, db: &dyn HirDatabase) -> Option<AttrsWithOwner>
Trait Implementations§
source§impl PartialEq for ItemInNs
impl PartialEq for ItemInNs
impl Copy for ItemInNs
impl Eq for ItemInNs
impl StructuralPartialEq for ItemInNs
Auto Trait Implementations§
impl Freeze for ItemInNs
impl RefUnwindSafe for ItemInNs
impl Send for ItemInNs
impl Sync for ItemInNs
impl Unpin for ItemInNs
impl UnwindSafe for ItemInNs
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.