Add target.
This commit is contained in:
27
src/context/target.rs
Normal file
27
src/context/target.rs
Normal 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(),
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user