use crate::generation::{Artifact, GenerationContext, GenerationError, RenderContext};
use crate::infrastructure::Template;
use async_trait::async_trait;
#[async_trait]
pub trait ContextBuilder: Send + Sync {
async fn build(
&self,
context: &GenerationContext,
template: &Template,
) -> Result<RenderContext, GenerationError>;
}
#[async_trait]
pub trait TemplateRenderingStrategy: Send + Sync {
async fn render(
&self,
template: &Template,
context: &RenderContext,
generation_context: &GenerationContext,
) -> Result<Vec<Artifact>, GenerationError>;
}
#[async_trait]
pub trait PostProcessor: Send + Sync {
async fn process(
&self,
artifacts: Vec<Artifact>,
context: &GenerationContext,
post_generation_commands: &[String],
) -> Result<Vec<Artifact>, GenerationError>;
}
#[async_trait]
pub trait OpenApiLoader: Send + Sync {
async fn load(
&self,
source: &str,
) -> Result<crate::generation::OpenApiContext, GenerationError>;
}