pub enum Action {
CreateDirectory {
dest: PathBuf,
},
CopyFile {
src: PathBuf,
dest: PathBuf,
},
WriteTemplate {
src: PathBuf,
dest: PathBuf,
},
}
Expand description
Instruction for performing a filesystem action or template processing.
Variants§
CreateDirectory
Specifies to create a new directory at dest
.
CopyFile
Specifies to copy the file at src
to dest
.
WriteTemplate
Specifies to render the template at src
to dest
.
Implementations§
source§impl Action
impl Action
sourcepub fn new_create_directory<E>(
dest: &Path,
transform_path: impl Fn(&Path) -> Result<PathBuf, E>,
) -> Result<Self, E>
pub fn new_create_directory<E>( dest: &Path, transform_path: impl Fn(&Path) -> Result<PathBuf, E>, ) -> Result<Self, E>
Create a new Action::CreateDirectory
.
Uses transform_path
to transform dest
.
sourcepub fn new_copy_file<E>(
src: &Path,
dest: &Path,
transform_path: impl Fn(&Path) -> Result<PathBuf, E>,
) -> Result<Self, E>
pub fn new_copy_file<E>( src: &Path, dest: &Path, transform_path: impl Fn(&Path) -> Result<PathBuf, E>, ) -> Result<Self, E>
Create a new Action::CopyFile
.
Uses transform_path
to transform dest
.
sourcepub fn new_write_template<E>(
src: &Path,
dest: &Path,
transform_path: impl Fn(&Path) -> Result<PathBuf, E>,
) -> Result<Self, E>
pub fn new_write_template<E>( src: &Path, dest: &Path, transform_path: impl Fn(&Path) -> Result<PathBuf, E>, ) -> Result<Self, E>
Create a new Action::WriteTemplate
.
Uses transform_path
to transform dest
.
pub fn is_create_directory(&self) -> bool
pub fn is_copy_file(&self) -> bool
pub fn is_write_template(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnwindSafe for Action
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