use crate::acg::capability::BackendCapabilities;
use crate::acg::plugin::{PluginInput, PluginOutput, ProviderPlugin};
use crate::acg::types::{ReasonCode, TranslationReport};
pub struct PassthroughPlugin;
impl ProviderPlugin for PassthroughPlugin {
fn plugin_id(&self) -> &str {
"passthrough"
}
fn plugin_name(&self) -> &str {
"Passthrough (No-Op)"
}
fn translate(&self, input: &PluginInput<'_>) -> crate::acg::error::Result<PluginOutput> {
let translated_request = input.rewritten_request.clone();
let translation_report = TranslationReport::all_ignored(
input.intent_bundle,
"passthrough",
ReasonCode::NotRelevant,
Some("passthrough plugin applies no transformations".to_string()),
);
Ok(PluginOutput {
translated_request,
translation_report,
})
}
fn capabilities(&self) -> BackendCapabilities {
BackendCapabilities::none("passthrough")
}
}
#[cfg(test)]
#[path = "../../tests/unit/acg/passthrough_tests.rs"]
mod tests;