Add target.

This commit is contained in:
Tom Alexander
2023-10-27 14:54:54 -04:00
parent c6cf5f75ac
commit 7b01230234
9 changed files with 80 additions and 15 deletions

27
src/context/target.rs Normal file
View File

@@ -0,0 +1,27 @@
use std::path::Path;
use serde::Serialize;
use crate::config::Config;
use crate::error::CustomError;
use crate::intermediate::ITarget;
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
#[serde(rename = "target")]
pub(crate) struct RenderTarget {
id: String,
}
impl RenderTarget {
pub(crate) fn new<D: AsRef<Path>, F: AsRef<Path>>(
config: &Config,
output_directory: D,
output_file: F,
target: &ITarget,
) -> Result<RenderTarget, CustomError> {
Ok(RenderTarget {
id: target.id.clone(),
})
}
}