pub struct Scan {
pub entries: BTreeMap<String, ScanEntry>,
pub held: BTreeSet<String>,
/* private fields */
}Expand description
What a walk found: every regular file it could stat, and every path
it was refused (held).
Fields§
§entries: BTreeMap<String, ScanEntry>§held: BTreeSet<String>Paths the syncer may not read (EACCES or EPERM, which std reports
alike as PermissionDenied: either is a refusal the tree’s owner
set), each standing for itself and everything under it: a
directory it may not list (written with
its trailing /), an entry it may not lstat (a name in a directory
it may list but not search, so even its type is unknown). And a
file or directory whose name is not UTF-8, which no key can name:
held under its lossy form (read_dir_entries). The
barrier adds the files it may not open and the absences it may not
confirm. Nothing held is published or deleted, and no boundary is
complete while anything is held.
This is how each one is SHOWN (in the report, the ack, the log).
What each one stands for is its Hold, kept apart (hold): the
lossy form of a name that is not UTF-8 may spell a real name, and a
file has nothing under it.
Implementations§
Source§impl Scan
impl Scan
Sourcepub fn hold(&mut self, shown: String, kind: Hold)
pub fn hold(&mut self, shown: String, kind: Hold)
Hold the path shown as shown (a directory with its trailing /).
Sourcepub fn holds(&self, path: &str) -> bool
pub fn holds(&self, path: &str) -> bool
Whether path is held: a held file itself, or at or under a held
tree.
Sourcepub fn present<'a, V>(
&'a self,
cited: &'a BTreeMap<String, V>,
) -> impl Iterator<Item = &'a String> + 'a
pub fn present<'a, V>( &'a self, cited: &'a BTreeMap<String, V>, ) -> impl Iterator<Item = &'a String> + 'a
What prev_scan records after this scan, in order: every path the
walk saw, and every path in cited that it held. A held path is
unseen, not absent, so it is recorded PRESENT: a path that turns
out to be gone once it is readable again is then a first absence,
and the two-scan rule withholds its delete one more scan, exactly
as for a path seen a scan ago.