oag_core/lib.rs
1pub mod config;
2pub mod error;
3pub mod ir;
4pub mod parse;
5pub mod transform;
6
7/// A generated file with path and content.
8#[derive(Debug, Clone)]
9pub struct GeneratedFile {
10 pub path: String,
11 pub content: String,
12}
13
14/// Trait for code generators that produce files from an IR spec.
15pub trait CodeGenerator {
16 type Config;
17 type Error: std::error::Error;
18 fn generate(
19 &self,
20 ir: &ir::IrSpec,
21 config: &Self::Config,
22 ) -> Result<Vec<GeneratedFile>, Self::Error>;
23}