use camino::Utf8PathBuf;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct GeneratedDyndep {
pub(super) relative_path: Utf8PathBuf,
pub(super) content: String,
}
impl GeneratedDyndep {
#[must_use]
pub const fn relative_path(&self) -> &Utf8PathBuf {
&self.relative_path
}
#[must_use]
pub fn content(&self) -> &str {
&self.content
}
}
#[derive(Debug, Clone)]
pub struct GeneratedNinja {
pub(super) build_file: String,
pub(super) dyndep_files: Vec<GeneratedDyndep>,
}
impl GeneratedNinja {
#[must_use]
pub fn build_file(&self) -> &str {
&self.build_file
}
#[must_use]
pub fn dyndep_files(&self) -> &[GeneratedDyndep] {
&self.dyndep_files
}
#[must_use]
pub fn into_parts(self) -> (String, Vec<GeneratedDyndep>) {
(self.build_file, self.dyndep_files)
}
}
#[cfg(test)]
impl GeneratedDyndep {
#[must_use]
pub(crate) fn fixture(relative_path: Utf8PathBuf, content: String) -> Self {
Self {
relative_path,
content,
}
}
}