pub trait SeedFolder {
// Required methods
fn seed_name(&self) -> &str;
fn root_dir(&self) -> impl AsRef<Path>;
fn cell_template(&self) -> &CellDocument;
// Provided methods
fn seed_dir(&self) -> impl AsRef<Path> { ... }
fn create_seed_dir(&self) -> Result<PathBuf, SeedingErrors> { ... }
fn soft_link_potentials<P: AsRef<Path>>(
&self,
potential_src: P,
) -> Result<(), SeedingErrors> { ... }
fn create_seed_file<P: AsRef<Path>, F: AsRef<[u8]>>(
&self,
filename: P,
file_content: F,
) -> Result<(), SeedingErrors> { ... }
fn write_files(
&self,
cell_builder: &impl CellBuilding,
param_builder: &impl ParamBuilding,
) -> Result<(), SeedingErrors> { ... }
fn actions<P: AsRef<Path>>(
&self,
cell_builder: &impl CellBuilding,
param_builder: &impl ParamBuilding,
potential_src: P,
) -> Result<(), SeedingErrors> { ... }
}Expand description
A trait of how to create seed file folders. Required psuedopotential files must be copied to the root dir first.
Required Methods§
fn seed_name(&self) -> &str
fn root_dir(&self) -> impl AsRef<Path>
fn cell_template(&self) -> &CellDocument
Provided Methods§
Sourcefn seed_dir(&self) -> impl AsRef<Path>
fn seed_dir(&self) -> impl AsRef<Path>
Join seed name after the root dir as the seed directory. You might implement this by yourself to customize the seed directory naming logic.
fn create_seed_dir(&self) -> Result<PathBuf, SeedingErrors>
fn soft_link_potentials<P: AsRef<Path>>( &self, potential_src: P, ) -> Result<(), SeedingErrors>
fn create_seed_file<P: AsRef<Path>, F: AsRef<[u8]>>( &self, filename: P, file_content: F, ) -> Result<(), SeedingErrors>
Sourcefn write_files(
&self,
cell_builder: &impl CellBuilding,
param_builder: &impl ParamBuilding,
) -> Result<(), SeedingErrors>
fn write_files( &self, cell_builder: &impl CellBuilding, param_builder: &impl ParamBuilding, ) -> Result<(), SeedingErrors>
Here generates and writes all files needed. Implement by yourself to change the behavior.
Sourcefn actions<P: AsRef<Path>>(
&self,
cell_builder: &impl CellBuilding,
param_builder: &impl ParamBuilding,
potential_src: P,
) -> Result<(), SeedingErrors>
fn actions<P: AsRef<Path>>( &self, cell_builder: &impl CellBuilding, param_builder: &impl ParamBuilding, potential_src: P, ) -> Result<(), SeedingErrors>
One command to do all
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.