ryo_executor/executor/registry/converters/
plugin.rs1use crate::engine::ASTRegApply;
10use crate::executor::registry::converter::{ConvertError, MutationConverter};
11use crate::executor::registry::converters::ResolveTargetSymbol;
12use crate::executor::spec::MutationSpec;
13use ryo_analysis::AnalysisContext;
14
15pub struct PluginConverter;
21
22impl PluginConverter {
23 pub fn new() -> Self {
24 Self {}
25 }
26}
27
28impl ResolveTargetSymbol for PluginConverter {}
30
31impl Default for PluginConverter {
32 fn default() -> Self {
33 Self::new()
34 }
35}
36
37impl MutationConverter for PluginConverter {
38 fn spec_kinds(&self) -> &'static [&'static str] {
39 &["PluginTransform"]
40 }
41
42 fn convert_v2(
43 &self,
44 _spec: &MutationSpec,
45 _ctx: &AnalysisContext,
46 ) -> Result<Vec<Box<dyn ASTRegApply>>, ConvertError> {
47 Err(ConvertError::V2NotSupported)
49 }
50}
51
52#[cfg(test)]
53mod tests {
54 use super::*;
55
56 #[test]
57 fn test_plugin_converter_spec_kinds() {
58 let converter = PluginConverter::new();
59 assert_eq!(converter.spec_kinds(), &["PluginTransform"]);
60 }
61}