Skip to main content

HasModule

Trait HasModule 

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

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

Required Methods§

Source

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

Returns the enclosing module this thing is defined within.

Provided Methods§

Source

fn krate(&self, db: &dyn SourceDatabase) -> Crate

Returns the crate this thing is defined within.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§