pub struct TemplatePack {
pub manifest: PackManifest,
pub templates: HashMap<String, String>,
}Expand description
A loaded template pack ready for code generation.
Fields§
§manifest: PackManifest§templates: HashMap<String, String>Template name → template content.
Implementations§
Source§impl TemplatePack
impl TemplatePack
Sourcepub fn from_dir(dir: &Path) -> Result<Self, GeneratorError>
pub fn from_dir(dir: &Path) -> Result<Self, GeneratorError>
Load a template pack from a directory containing oag.pack.toml and templates/.
Sourcepub fn merge_from(&mut self, extending: &TemplatePack)
pub fn merge_from(&mut self, extending: &TemplatePack)
Merge another pack into this one (for extends support).
The extending pack’s entries override the base.
Trait Implementations§
Source§impl Clone for TemplatePack
impl Clone for TemplatePack
Source§fn clone(&self) -> TemplatePack
fn clone(&self) -> TemplatePack
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TemplatePack
impl RefUnwindSafe for TemplatePack
impl Send for TemplatePack
impl Sync for TemplatePack
impl Unpin for TemplatePack
impl UnsafeUnpin for TemplatePack
impl UnwindSafe for TemplatePack
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