struct Job<'a> {Show 16 fields
config: &'a JobConfig,
op_id: String,
kind: FsOpKind,
control: Arc<OpControl>,
emit: Arc<dyn Fn(&FsOpEvent) + Send + Sync>,
protect: ProtectedPaths,
done_items: u64,
total_items: u64,
done_bytes: u64,
total_bytes: u64,
current: Option<String>,
failures: Vec<FsOpResult>,
sticky: Option<FsOpChoice>,
stop_reason: Option<String>,
last_running: Option<Instant>,
buf: Vec<u8>,
}Fields§
§config: &'a JobConfig§op_id: String§kind: FsOpKind§control: Arc<OpControl>§emit: Arc<dyn Fn(&FsOpEvent) + Send + Sync>§protect: ProtectedPaths§done_items: u64§total_items: u64§done_bytes: u64§total_bytes: u64§current: Option<String>§failures: Vec<FsOpResult>§sticky: Option<FsOpChoice>An answer given with “apply to all”.
stop_reason: Option<String>Why the op stopped by itself, for the final canceled event.
last_running: Option<Instant>§buf: Vec<u8>Implementations§
Source§impl<'a> Job<'a>
impl<'a> Job<'a>
fn new( config: &'a JobConfig, op_id: String, kind: FsOpKind, control: Arc<OpControl>, emit: Arc<dyn Fn(&FsOpEvent) + Send + Sync>, ) -> Self
fn verb(&self) -> &'static str
fn event(&self, state: FsOpEventState) -> FsOpEvent
fn emit_now(&mut self, state: FsOpEventState)
Sourcefn tick(&mut self)
fn tick(&mut self)
A running event, unless one went out within PROGRESS_INTERVAL.
Dropping one loses nothing: the next carries the counts, and the
final event always goes out.
fn set_current(&mut self, src: &Path)
fn advance(&mut self, m: Measure)
fn fail(&mut self, src: &Path, error: String)
Sourcefn pass_over(&mut self, src: &Path, meta: &Metadata, hint: Option<Measure>)
fn pass_over(&mut self, src: &Path, meta: &Metadata, hint: Option<Measure>)
Count src’s subtree as handled without copying it (skipped, or
failed before anything was written), so progress still reaches the
total.
fn finish(&mut self, ending: Ending, requested: usize, dest: &str)
fn execute(&mut self, plan: &Plan) -> Ending
Sourcefn measure(&self, path: &Path) -> Option<Measure>
fn measure(&self, path: &Path) -> Option<Measure>
Count entries and file bytes under path without following links.
What can’t be read counts as one entry; the copy reports it.
None if canceled meanwhile.
Sourcefn transfer(
&mut self,
src: &Path,
dest: &Path,
duplicate: bool,
hint: Option<Measure>,
cross: bool,
) -> Outcome
fn transfer( &mut self, src: &Path, dest: &Path, duplicate: bool, hint: Option<Measure>, cross: bool, ) -> Outcome
Copy or move src to dest, asking about a conflict, merging a
folder into a folder. hint is src’s measure when already known.
cross is set inside a move that already found it crosses volumes,
so each entry doesn’t retry the rename.
Sourcefn ask(
&mut self,
src: &Path,
meta: &Metadata,
dest: &Path,
dest_meta: &Metadata,
) -> Option<FsOpChoice>
fn ask( &mut self, src: &Path, meta: &Metadata, dest: &Path, dest_meta: &Metadata, ) -> Option<FsOpChoice>
Block in conflict until answered. None if canceled, or if the
wait limit passed (then stop_reason says so).
Sourcefn ask_about(
&mut self,
src: &str,
meta: EntrySide,
dest: &str,
dest_meta: EntrySide,
) -> Option<FsOpChoice>
fn ask_about( &mut self, src: &str, meta: EntrySide, dest: &str, dest_meta: EntrySide, ) -> Option<FsOpChoice>
Self::ask for any two entries, local or on a host, by their display
paths and what they are.
Sourcefn place(
&mut self,
src: &Path,
meta: &Metadata,
dest: &Path,
how: How,
hint: Option<Measure>,
cross: bool,
) -> Result<Outcome, Raced>
fn place( &mut self, src: &Path, meta: &Metadata, dest: &Path, how: How, hint: Option<Measure>, cross: bool, ) -> Result<Outcome, Raced>
Put src at dest the way how says.
fn place_by_rename( &mut self, src: &Path, meta: &Metadata, dest: &Path, how: How, hint: Option<Measure>, ) -> Renamed
fn place_file( &mut self, src: &Path, meta: &Metadata, dest: &Path, how: How, ) -> Result<Outcome, Raced>
Sourcefn settle_file(&mut self, start_bytes: u64, meta: &Metadata)
fn settle_file(&mut self, start_bytes: u64, meta: &Metadata)
The file’s progress once it is handled, whatever happened: one item, and its size (or what was written, if it grew).
Sourcefn copy_to_temp(
&mut self,
src: &Path,
meta: &Metadata,
dest: &Path,
) -> Result<PathBuf, CopyError>
fn copy_to_temp( &mut self, src: &Path, meta: &Metadata, dest: &Path, ) -> Result<PathBuf, CopyError>
Stream src into a new temporary file beside dest. On any error
or cancel the temporary file is removed.
Sourcefn stream(
&mut self,
from: &mut File,
to: &mut File,
src: &Path,
) -> Result<u64, CopyError>
fn stream( &mut self, from: &mut File, to: &mut File, src: &Path, ) -> Result<u64, CopyError>
Copy all of from into to in chunk_size pieces, checking for
cancel before each. Returns the bytes written.
fn stream_with( &mut self, buf: &mut [u8], from: &mut File, to: &mut File, src: &Path, ) -> Result<u64, CopyError>
fn place_link( &mut self, src: &Path, meta: &Metadata, dest: &Path, how: How, ) -> Result<Outcome, Raced>
fn place_dir( &mut self, src: &Path, meta: &Metadata, dest: &Path, how: How, cross: bool, ) -> Result<Outcome, Raced>
Sourcefn merge(&mut self, src: &Path, dest: &Path, cross: bool) -> Outcome
fn merge(&mut self, src: &Path, dest: &Path, cross: bool) -> Outcome
Merge the folder src into the existing folder dest (spec §7.2).
Sourcefn remove_moved_dir(&mut self, src: &Path) -> Outcome
fn remove_moved_dir(&mut self, src: &Path) -> Outcome
A moved folder’s source, once everything inside it went. Only ever
an empty folder: remove_dir refuses anything else.
Sourcefn copy_children(&mut self, src: &Path, dest: &Path, cross: bool) -> Outcome
fn copy_children(&mut self, src: &Path, dest: &Path, cross: bool) -> Outcome
Each entry of src into dest. The names are read up front: a move
takes entries out of src while going, and a directory changing
under an open listing may skip entries on some filesystems.
Sourcefn replace_aside(
&mut self,
src: &Path,
dest: &Path,
put: impl FnOnce(&Path) -> Result<()>,
) -> Result<()>
fn replace_aside( &mut self, src: &Path, dest: &Path, put: impl FnOnce(&Path) -> Result<()>, ) -> Result<()>
Replace dest with what put creates there: move dest aside under
a temporary name in the same folder first, remove it once put
succeeded, or put it back if put failed. Used whenever a rename
can’t atomically replace (a folder, a link, a type change).
Sourcefn drop_aside(&mut self, src: &Path, spot: &Path)
fn drop_aside(&mut self, src: &Path, spot: &Path)
Delete the replaced original. It was the user’s choice to replace it; failing to delete it is reported but loses nothing.
Sourcefn restore_aside(&mut self, src: &Path, spot: &Path, dest: &Path)
fn restore_aside(&mut self, src: &Path, spot: &Path, dest: &Path)
Put a set-aside original back at dest, or, if something took that
name meanwhile, under the first free name (n) beside it rather
than leave it under a hidden temporary name.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Job<'a>
impl<'a> !UnwindSafe for Job<'a>
impl<'a> Freeze for Job<'a>
impl<'a> Send for Job<'a>
impl<'a> Sync for Job<'a>
impl<'a> Unpin for Job<'a>
impl<'a> UnsafeUnpin for Job<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more