mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
feat(router): Add Smart Routing to route payments efficiently (#2665)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: shashank_attarde <shashank.attarde@juspay.in> Co-authored-by: Aprabhat19 <amishaprabhat@gmail.com> Co-authored-by: Amisha Prabhat <55580080+Aprabhat19@users.noreply.github.com>
This commit is contained in:
25
crates/euclid/src/backend.rs
Normal file
25
crates/euclid/src/backend.rs
Normal file
@ -0,0 +1,25 @@
|
||||
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,
|
||||
}
|
||||
|
||||
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>;
|
||||
}
|
||||
Reference in New Issue
Block a user