pub trait CodeAnalyzer: Send + Sync {
// Required methods
fn analyze_structure<'life0, 'async_trait>(
&'life0 self,
file: PathBuf,
) -> Pin<Box<dyn Future<Output = Layer3Result<CodeStructure>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_similar<'life0, 'life1, 'async_trait>(
&'life0 self,
snippet: &'life1 str,
threshold: f32,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<CodeMatch>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn detect_patterns<'life0, 'async_trait>(
&'life0 self,
file: PathBuf,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<DetectedPattern>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
代码分析器 trait
提供更高级的代码分析能力。
Required Methods§
Sourcefn analyze_structure<'life0, 'async_trait>(
&'life0 self,
file: PathBuf,
) -> Pin<Box<dyn Future<Output = Layer3Result<CodeStructure>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn analyze_structure<'life0, 'async_trait>(
&'life0 self,
file: PathBuf,
) -> Pin<Box<dyn Future<Output = Layer3Result<CodeStructure>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
分析代码结构
Sourcefn find_similar<'life0, 'life1, 'async_trait>(
&'life0 self,
snippet: &'life1 str,
threshold: f32,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<CodeMatch>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_similar<'life0, 'life1, 'async_trait>(
&'life0 self,
snippet: &'life1 str,
threshold: f32,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<CodeMatch>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
查找相似代码
Sourcefn detect_patterns<'life0, 'async_trait>(
&'life0 self,
file: PathBuf,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<DetectedPattern>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn detect_patterns<'life0, 'async_trait>(
&'life0 self,
file: PathBuf,
) -> Pin<Box<dyn Future<Output = Layer3Result<Vec<DetectedPattern>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
检测代码模式
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".