pub struct GeneratorLoader;Expand description
Generator template loader
Implementations§
Source§impl GeneratorLoader
impl GeneratorLoader
Sourcepub fn load_file(
path: impl AsRef<Path>,
) -> Result<GeneratorTemplate, GeneratorLoadError>
pub fn load_file( path: impl AsRef<Path>, ) -> Result<GeneratorTemplate, GeneratorLoadError>
Load generator from a file (auto-detect format)
Sourcepub fn load_from_str(
content: &str,
path: impl AsRef<Path>,
) -> Result<GeneratorTemplate, GeneratorLoadError>
pub fn load_from_str( content: &str, path: impl AsRef<Path>, ) -> Result<GeneratorTemplate, GeneratorLoadError>
Load generator from string with path hint for format detection
Sourcepub fn from_yaml(yaml: &str) -> Result<GeneratorTemplate, GeneratorLoadError>
pub fn from_yaml(yaml: &str) -> Result<GeneratorTemplate, GeneratorLoadError>
Load from YAML string
Sourcepub fn from_json(json: &str) -> Result<GeneratorTemplate, GeneratorLoadError>
pub fn from_json(json: &str) -> Result<GeneratorTemplate, GeneratorLoadError>
Load from JSON string
Sourcepub fn load_dir(
dir: impl AsRef<Path>,
) -> Result<Vec<GeneratorTemplate>, GeneratorLoadError>
pub fn load_dir( dir: impl AsRef<Path>, ) -> Result<Vec<GeneratorTemplate>, GeneratorLoadError>
Load all generators from a directory
Auto Trait Implementations§
impl Freeze for GeneratorLoader
impl RefUnwindSafe for GeneratorLoader
impl Send for GeneratorLoader
impl Sync for GeneratorLoader
impl Unpin for GeneratorLoader
impl UnsafeUnpin for GeneratorLoader
impl UnwindSafe for GeneratorLoader
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