pub mod execute;
pub mod types;
pub mod validate;
pub use execute::{execute, execute_with_metadata};
pub use types::*;
pub use validate::validate;
#[cfg(test)]
mod tests;
use crate::cluster::{ExpandedGraph, PrimitiveCatalog};
#[derive(Debug)]
#[non_exhaustive]
pub enum RuntimeError {
Validation(types::GraphValidationError),
Execution(types::ExecError),
}
pub fn run<C: PrimitiveCatalog>(
expanded: &ExpandedGraph,
catalog: &C,
registries: &types::Registries,
ctx: &types::ExecutionContext,
) -> Result<types::ExecutionReport, RuntimeError> {
let validated = validate(expanded, catalog).map_err(RuntimeError::Validation)?;
execute(&validated, registries, ctx).map_err(RuntimeError::Execution)
}