Struct fs_extra::dir::CopyOptions

source ·
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

source

pub fn new() -> CopyOptions

Initialize struct CopyOptions with default value.

overwrite: false

skip_exist: false

buffer_size: 64000 // 64kb

copy_inside: false
source

pub fn overwrite(self, overwrite: bool) -> Self

Overwrite existing files if true.

source

pub fn skip_exist(self, skip_exist: bool) -> Self

Skip existing files if true.

source

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.

source

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)

source

pub fn content_only(self, content_only: bool) -> Self

Copy only contents without a creating a new folder in the destination folder.

source

pub fn depth(self, depth: u64) -> Self

Sets levels reading. Set 0 for read all directory folder

Trait Implementations§

source§

impl Clone for CopyOptions

source§

fn clone(&self) -> CopyOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for CopyOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere
    T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.