Skip to main content

Oracle

Trait Oracle 

Source
pub trait Oracle: Send + Sync {
    // Required method
    fn refers(&self, file: &Path, span: Span) -> Option<Referent>;
}
Expand description

The nouns of the plugin contract that appear in the engine’s answers, so an interface needs nothing but this crate. Something that can say what an identifier refers to. Asked one token at a time, only for tokens the graph could not judge, and never trusted blindly: the engine maps the answer onto a declaration it knows before it counts. Implementations are free to answer None for anything.

Required Methods§

Source

fn refers(&self, file: &Path, span: Span) -> Option<Referent>

The declaration the identifier at span in file refers to, when the oracle knows.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§