Struct nuts_directory::CreateOptions
source · pub struct CreateOptions { /* private fields */ }Expand description
Options needed to create the backend.
You must pass the path, where the directory tree should be stored, to
CreateOptions::for_path(), if creating a CreateOptions instance.
Furthermore the following options can be specified:
CreateOptions::with_overwrite(): If set totruean already existing path is reused. Note: If you overwrite an existing path, the content is not removed! If set tofalseand the base path exists, the build operation aborts withError::Exists. The default isfalse.CreateOptions::with_bsize(): Specifies the block size of the backend. This is the number of bytes, which can be stored in an individual block. The minimum block size is 512 bytes. The default is512.
Implementations§
source§impl CreateOptions
impl CreateOptions
sourcepub fn for_path<P: AsRef<Path>>(path: P) -> Self
pub fn for_path<P: AsRef<Path>>(path: P) -> Self
Creates a new CreateOptions instance.
You must pass the path, where the directory tree should be stored, to
the function.
For further options default values are applied.
sourcepub fn with_overwrite(self, overwrite: bool) -> Self
pub fn with_overwrite(self, overwrite: bool) -> Self
Assigns a new overwrite flag to the options.
If set to true an already existing path is reused. Note: If you
overwrite an existing path, the content is not removed! If set to
false and the base path exists, the build operation aborts with
Error::Exists.
sourcepub fn with_bsize(self, bsize: u32) -> Self
pub fn with_bsize(self, bsize: u32) -> Self
Assigns a new block size to the options.
This is the number of bytes, which can be stored in an individual block.
Trait Implementations§
source§impl Clone for CreateOptions
impl Clone for CreateOptions
source§fn clone(&self) -> CreateOptions
fn clone(&self) -> CreateOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more