pub struct Project {
pub root: PathBuf,
pub manifest: Manifest,
pub templates: HashMap<String, TemplateFile>,
pub partials: HashMap<String, PartialFile>,
pub fixtures: HashMap<String, Context>,
pub scenarios: HashMap<String, Scenario>,
}Fields§
§root: PathBuf§manifest: Manifest§templates: HashMap<String, TemplateFile>§partials: HashMap<String, PartialFile>§fixtures: HashMap<String, Context>§scenarios: HashMap<String, Scenario>Implementations§
Source§impl Project
impl Project
pub fn load_from_dir(path: impl AsRef<Path>) -> Result<Self, ProjectError>
Source§impl Project
impl Project
Sourcepub fn validate(&self) -> Vec<ValidationIssue>
pub fn validate(&self) -> Vec<ValidationIssue>
Walk every template; report unknown pipes and unknown partial references as validation issues. Does not error.
Sourcepub fn save_template(&self, key: &str) -> Result<(), ProjectError>
pub fn save_template(&self, key: &str) -> Result<(), ProjectError>
Write the named template back to disk as TOML.
Sourcepub fn save_partial(&self, name: &str) -> Result<(), ProjectError>
pub fn save_partial(&self, name: &str) -> Result<(), ProjectError>
Write the named partial back to disk as TOML.
Sourcepub fn save_scenario(&self, name: &str) -> Result<(), ProjectError>
pub fn save_scenario(&self, name: &str) -> Result<(), ProjectError>
Write the named scenario back to disk as TOML.
Source§impl Project
impl Project
Sourcepub fn into_engine(&self) -> Result<Engine, ProjectError>
pub fn into_engine(&self) -> Result<Engine, ProjectError>
Materialize a configured Engine from this project.
v1: English only; multi-grammar selection by manifest is plumbed
at the variant level (per-variant language field) but the
engine itself is single-grammar in v1.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin for Project
impl UnwindSafe for Project
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more