Skip to main content

Sources

Trait Sources 

Source
pub trait Sources {
    // Required method
    fn read(&self, path: &Path) -> Result<String>;

    // Provided method
    fn same_file(&self, a: &Path, b: &Path) -> bool { ... }
}
Expand description

Where analyze reads a module’s text.

Required Methods§

Source

fn read(&self, path: &Path) -> Result<String>

The text of path: an editor’s buffer if one is open, else the file.

Provided Methods§

Source

fn same_file(&self, a: &Path, b: &Path) -> bool

Whether a and b name the same file. The default compares them as written; the language server compares normalised paths.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§