pub struct ProjectGenerator { /* private fields */ }Expand description
Atomic application project generator.
Implementations§
Source§impl ProjectGenerator
impl ProjectGenerator
Sourcepub fn new(parent: impl Into<Utf8PathBuf>, request: ProjectRequest) -> Self
pub fn new(parent: impl Into<Utf8PathBuf>, request: ProjectRequest) -> Self
Create a generator rooted at an existing parent directory.
Sourcepub fn plan(&self) -> Result<GenerationPlan, GenerationError>
pub fn plan(&self) -> Result<GenerationPlan, GenerationError>
Validate and list changes without touching the filesystem.
§Errors
Returns an error when names or configuration are invalid, or a template cannot be rendered.
Sourcepub fn generate(&self) -> Result<GeneratedProject, GenerationError>
pub fn generate(&self) -> Result<GeneratedProject, GenerationError>
Generate into a sibling temporary directory and rename only after every write succeeds.
§Errors
Returns an error when validation, template rendering, filesystem writes, or the final atomic rename fails.
Trait Implementations§
Source§impl Clone for ProjectGenerator
impl Clone for ProjectGenerator
Auto Trait Implementations§
impl Freeze for ProjectGenerator
impl RefUnwindSafe for ProjectGenerator
impl Send for ProjectGenerator
impl Sync for ProjectGenerator
impl Unpin for ProjectGenerator
impl UnsafeUnpin for ProjectGenerator
impl UnwindSafe for ProjectGenerator
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