Skip to main content

LanguagePlugin

Trait LanguagePlugin 

Source
pub trait LanguagePlugin {
    // Required methods
    fn language(&self) -> &'static str;
    fn extensions(&self) -> &[&str];
    fn extract(&self, file: &str, source: &str) -> Vec<Symbol>;
}
Expand description

Extracts definitions from a single source file.

Required Methods§

Source

fn language(&self) -> &'static str

The language tag emitted on every Symbol (e.g. "ruby"). Also the canonical name --lang matches against.

Source

fn extensions(&self) -> &[&str]

File extensions this plugin handles, without the dot (e.g. ["rb"]).

Source

fn extract(&self, file: &str, source: &str) -> Vec<Symbol>

Extract definitions from source. file is the repo-relative path, recorded on each emitted Symbol.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§