Trait hir_def::HasModule

source ·
pub trait HasModule {
    // Required method
    fn module(&self, db: &dyn DefDatabase) -> ModuleId;

    // Provided method
    fn krate(&self, db: &dyn DefDatabase) -> CrateId { ... }
}

Required Methods§

source

fn module(&self, db: &dyn DefDatabase) -> ModuleId

Returns the enclosing module this thing is defined within.

Provided Methods§

source

fn krate(&self, db: &dyn DefDatabase) -> CrateId

Returns the crate this thing is defined within.

Implementors§