Files
Sai Harsha Vardhan e90a95de6f feat(router): add three_ds decision rule execute api (#8148)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
2025-06-06 16:20:34 +00:00

33 lines
787 B
Rust

pub mod inputs;
pub mod interpreter;
#[cfg(feature = "valued_jit")]
pub mod vir_interpreter;
pub use inputs::BackendInput;
pub use interpreter::InterpreterBackend;
#[cfg(feature = "valued_jit")]
pub use vir_interpreter::VirInterpreterBackend;
use crate::frontend::ast;
#[derive(Debug, Clone, serde::Serialize)]
pub struct BackendOutput<O> {
pub rule_name: Option<String>,
pub connector_selection: O,
}
impl<O> BackendOutput<O> {
// get_connector_selection
pub fn get_output(&self) -> &O {
&self.connector_selection
}
}
pub trait EuclidBackend<O>: Sized {
type Error: serde::Serialize;
fn with_program(program: ast::Program<O>) -> Result<Self, Self::Error>;
fn execute(&self, input: BackendInput) -> Result<BackendOutput<O>, Self::Error>;
}