pub struct EntryCx {
pub parent: Arc<Dir>,
pub name: OsString,
pub rel_path: PathBuf,
pub filter_path: PathBuf,
pub real_path: PathBuf,
pub dry_run: bool,
pub prog_track: &'static Progress,
}Expand description
Owned per-entry context handed to every WalkVisitor method.
All fields are owned so the whole context can move into a spawned task (tasks
are 'static). It carries the hardened parent Dir (an Arc, cloned, never
borrowed) and the entry’s accumulated paths.
Fields§
§parent: Arc<Dir>The hardened directory that contains this entry. Cloned into each child
task; every open below it is O_NOFOLLOW.
name: OsStringThis entry’s name within parent.
rel_path: PathBufPath accumulated from the walk root to this entry (empty for the root entry). Joined onto the tool’s root it reconstructs the real path; used for diagnostics and path reconstruction.
filter_path: PathBufThe path the driver feeds to the include/exclude filter for this entry: the
entry’s logical path relative to the filter root. Usually equals
rel_path, but a tool processing a delegated subtree (rlink handing an
update-only or type-changed subtree to copy, which is rooted below the
original filter root) seeds the root entry’s filter_path with that subtree’s
logical base so the filter still matches at the entry’s true path (e.g.
cache/keep.txt, not the bare keep.txt relative to the delegated root). The
driver extends it by one component per level alongside rel_path.
real_path: PathBufroot.join(rel_path) — the reconstructed real filesystem path, for
diagnostics and the deliberately-path-based features (-L/--delete).
dry_run: boolWhether this is a dry run (no filesystem mutation).
prog_track: &'static ProgressThe process-global progress tracker.
Implementations§
Source§impl EntryCx
impl EntryCx
Sourcepub fn child(&self, child_dir: Arc<Dir>, child_name: &OsStr) -> EntryCx
pub fn child(&self, child_dir: Arc<Dir>, child_name: &OsStr) -> EntryCx
Build the child context for child_name within child_dir, extending the
accumulated rel_path/filter_path/real_path by one component. child_dir
is the hardened directory the child lives in (for a directory entry’s
contents, the opened directory itself; for the root, the root directory).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EntryCx
impl RefUnwindSafe for EntryCx
impl Send for EntryCx
impl Sync for EntryCx
impl Unpin for EntryCx
impl UnsafeUnpin for EntryCx
impl UnwindSafe for EntryCx
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request