pub trait SemanticParserPlugin: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn extensions(&self) -> &[&str];
fn extract_entities(
&self,
content: &str,
file_path: &str,
) -> Vec<SemanticEntity>;
// Provided methods
fn extract_entities_with_tree(
&self,
content: &str,
file_path: &str,
) -> (Vec<SemanticEntity>, Option<Tree>) { ... }
fn structural_hash_content(
&self,
_content: &str,
_file_path: &str,
) -> Option<String> { ... }
fn compute_similarity(&self, a: &SemanticEntity, b: &SemanticEntity) -> f64 { ... }
}Required Methods§
fn id(&self) -> &str
fn extensions(&self) -> &[&str]
fn extract_entities( &self, content: &str, file_path: &str, ) -> Vec<SemanticEntity>
Provided Methods§
Sourcefn extract_entities_with_tree(
&self,
content: &str,
file_path: &str,
) -> (Vec<SemanticEntity>, Option<Tree>)
fn extract_entities_with_tree( &self, content: &str, file_path: &str, ) -> (Vec<SemanticEntity>, Option<Tree>)
Extract entities and optionally return the tree-sitter Tree for reuse. Default returns None for the tree (non-code plugins).
fn structural_hash_content( &self, _content: &str, _file_path: &str, ) -> Option<String>
fn compute_similarity(&self, a: &SemanticEntity, b: &SemanticEntity) -> f64
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".