pub trait HasModule {
// Required method
fn module(&self, db: &dyn DefDatabase) -> ModuleId;
// Provided method
fn krate(&self, db: &dyn DefDatabase) -> Crate { ... }
}
Required Methods§
Sourcefn module(&self, db: &dyn DefDatabase) -> ModuleId
fn module(&self, db: &dyn DefDatabase) -> ModuleId
Returns the enclosing module this thing is defined within.
Provided Methods§
Sourcefn krate(&self, db: &dyn DefDatabase) -> Crate
fn krate(&self, db: &dyn DefDatabase) -> Crate
Returns the crate this thing is defined within.