Skip to main content

Scan

Struct Scan 

Source
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

Source

pub fn hold(&mut self, shown: String, kind: Hold)

Hold the path shown as shown (a directory with its trailing /).

Source

pub fn holds(&self, path: &str) -> bool

Whether path is held: a held file itself, or at or under a held tree.

Source

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.

Trait Implementations§

Source§

impl Debug for Scan

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Scan

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Scan

§

impl RefUnwindSafe for Scan

§

impl Send for Scan

§

impl Sync for Scan

§

impl Unpin for Scan

§

impl UnsafeUnpin for Scan

§

impl UnwindSafe for Scan

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.