1pub mod expr;
6pub mod registry;
7pub mod runner;
8pub mod schema;
9
10use schema::PipelineDef;
11
12pub fn load(yaml: &str) -> Result<PipelineDef, serde_saphyr::Error> {
14 serde_saphyr::from_str(yaml)
15}
16
17pub fn load_file(path: impl AsRef<std::path::Path>) -> Result<PipelineDef, LoadError> {
19 let contents = std::fs::read_to_string(path)?;
20 Ok(serde_saphyr::from_str(&contents)?)
21}
22
23#[derive(Debug, thiserror::Error)]
24pub enum LoadError {
25 #[error("IO error: {0}")]
26 Io(#[from] std::io::Error),
27 #[error("YAML parse error: {0}")]
28 Yaml(#[from] serde_saphyr::Error),
29}
30
31pub use registry::HandlerRegistry;
32pub use runner::Runner;