Skip to main content

LanguageParser

Trait LanguageParser 

Source
pub trait LanguageParser: Send + Sync {
    // Required methods
    fn language(&self) -> Language;
    fn parse_file(&self, path: &Path, content: &str) -> Result<ParsedFile>;
}
Expand description

Language parser trait. Each parser extracts security-relevant operations from source files.

Required Methods§

Source

fn language(&self) -> Language

Source

fn parse_file(&self, path: &Path, content: &str) -> Result<ParsedFile>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl LanguageParser for PythonParser

Source§

impl LanguageParser for ShellParser

Source§

impl LanguageParser for TypeScriptParser

Available on crate feature typescript only.