use crate::error::{ManifestError, Result};
use crate::model::Manifest;
impl Manifest {
pub fn parse(yaml: &str) -> Result<Self> {
let manifest: Self = serde_norway::from_str(yaml).map_err(ManifestError::from)?;
manifest.validate()?;
Ok(manifest)
}
pub fn to_yaml(&self) -> Result<String> {
serde_norway::to_string(self).map_err(ManifestError::from)
}
}