mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
33 lines
787 B
Rust
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>;
|
|
}
|