use hyperlit_base::result::HyperlitResult;
use hyperlit_model::directive_evaluation::DirectiveEvaluation;
use hyperlit_model::segment::{Segment, SegmentId};
use std::path::Path;
pub trait BackendCompileParams {
fn docs_directory(&self) -> &Path;
fn build_directory(&self) -> &Path;
fn output_directory(&self) -> &Path;
fn evaluate_directive(&self, tag: &str) -> HyperlitResult<DirectiveEvaluation>;
fn set_segment_included(&mut self, segment_id: SegmentId) -> HyperlitResult<()>;
}
pub trait Backend {
fn prepare(&mut self, _params: &mut dyn BackendCompileParams) -> HyperlitResult<()> {
Ok(())
}
fn compile(&self, params: &dyn BackendCompileParams) -> HyperlitResult<()>;
fn transform_segment(&self, segment: &Segment) -> HyperlitResult<String>;
}
pub type BackendBox = Box<dyn Backend>;