pub struct DirectoryCopyProgressRef<'o> {
pub bytes_total: u64,
pub bytes_finished: u64,
pub files_copied: usize,
pub symlinks_created: usize,
pub directories_created: usize,
pub current_operation: &'o DirectoryCopyOperation,
pub current_operation_index: usize,
pub total_operations: usize,
}Expand description
Directory copying progress.
This struct is used to report progress to a user-provided closure
(see usage in copy_directory_with_progress).
Note that the data inside this struct isn’t fully owned - the current_operation
field is borrowed, and cloning will not have the desired effect.
To obtain a fully-owned clone of this state, call
DirectoryCopyProgressRef::to_owned_progress.
Fields§
§bytes_total: u64Total number of bytes that need to be copied for the directory copy to be complete.
bytes_finished: u64Number of bytes that have been copied so far.
files_copied: usizeNumber of files that have been copied so far.
symlinks_created: usizeNumber of symlinks that have been (re)created so far.
If the DirectoryCopyOptions::symlink_behaviour option is set to
SymlinkBehaviour::Follow, this will always be 0.
directories_created: usizeNumber of directories that have been created so far.
current_operation: &'o DirectoryCopyOperationThe current operation being performed.
current_operation_index: usizeThe index of the current operation.
Starts at 0, goes up to (including) total_operations - 1.
total_operations: usizeThe total number of operations that need to be performed to copy the requested directory.
A single operation is either copying a file or creating a directory,
see DirectoryCopyOperation.
Implementations§
Source§impl DirectoryCopyProgressRef<'_>
impl DirectoryCopyProgressRef<'_>
Sourcepub fn to_owned_progress(&self) -> DirectoryCopyProgress
pub fn to_owned_progress(&self) -> DirectoryCopyProgress
Clones the required data from this progress struct
into an DirectoryCopyProgress - this way you own
the entire state.
Trait Implementations§
Source§impl<'o> Clone for DirectoryCopyProgressRef<'o>
impl<'o> Clone for DirectoryCopyProgressRef<'o>
Source§fn clone(&self) -> DirectoryCopyProgressRef<'o>
fn clone(&self) -> DirectoryCopyProgressRef<'o>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'o> Debug for DirectoryCopyProgressRef<'o>
impl<'o> Debug for DirectoryCopyProgressRef<'o>
Source§impl<'o> PartialEq for DirectoryCopyProgressRef<'o>
impl<'o> PartialEq for DirectoryCopyProgressRef<'o>
Source§fn eq(&self, other: &DirectoryCopyProgressRef<'o>) -> bool
fn eq(&self, other: &DirectoryCopyProgressRef<'o>) -> bool
self and other values to be equal, and is used by ==.