pub struct CopyOptions {
pub overwrite: bool,
pub skip_exist: bool,
pub buffer_size: usize,
pub copy_inside: bool,
pub content_only: bool,
pub depth: u64,
}
Expand description
Options and flags which can be used to configure how a file will be copied or moved.
Fields§
§overwrite: bool
Overwrite existing files if true (default: false).
skip_exist: bool
Skip existing files if true (default: false).
buffer_size: usize
Buffer size that specifies the amount of bytes to be moved or copied before the progress handler is called. This only affects functions with progress handlers. (default: 64000)
copy_inside: bool
Recursively copy a directory with a new name or place it inside the destination (default: false, same behaviors as cp -r on Unix)
content_only: bool
Copy only contents without a creating a new folder in the destination folder (default: false).
depth: u64
Sets levels reading. Set 0 for read all directory folder (default: 0).
Warning: Work only for copy operations!
Implementations§
Source§impl CopyOptions
impl CopyOptions
Sourcepub fn new() -> CopyOptions
pub fn new() -> CopyOptions
Initialize struct CopyOptions with default value.
overwrite: false
skip_exist: false
buffer_size: 64000 // 64kb
copy_inside: false
Sourcepub fn skip_exist(self, skip_exist: bool) -> Self
pub fn skip_exist(self, skip_exist: bool) -> Self
Skip existing files if true.
Sourcepub fn buffer_size(self, buffer_size: usize) -> Self
pub fn buffer_size(self, buffer_size: usize) -> Self
Buffer size that specifies the amount of bytes to be moved or copied before the progress handler is called. This only affects functions with progress handlers.
Sourcepub fn copy_inside(self, copy_inside: bool) -> Self
pub fn copy_inside(self, copy_inside: bool) -> Self
Recursively copy a directory with a new name or place it inside the destination (default: false, same behaviors as cp -r on Unix)
Sourcepub fn content_only(self, content_only: bool) -> Self
pub fn content_only(self, content_only: bool) -> Self
Copy only contents without a creating a new folder in the destination folder.
Trait Implementations§
Source§impl Clone for CopyOptions
impl Clone for CopyOptions
Source§fn clone(&self) -> CopyOptions
fn clone(&self) -> CopyOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more