Skip to main content

FunctionExtractor

Trait FunctionExtractor 

Source
pub trait FunctionExtractor: Send + Sync {
    // Required methods
    fn grammar(&self) -> &'static str;
    fn formats(&self) -> &'static [&'static str];
    fn extract(&self, source: &str, format: &str) -> Vec<RawFunction>;
}
Expand description

Language plug-in for function extraction.

Required Methods§

Source

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

Stable identifier of the grammar behind the node-type ids.

Source

fn formats(&self) -> &'static [&'static str]

jscpd format names this extractor serves.

Source

fn extract(&self, source: &str, format: &str) -> Vec<RawFunction>

All functions of source; empty when the source does not parse.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§