Skip to main content

Delivery

Struct Delivery 

Source
pub struct Delivery {
    pub cache: CachePolicy,
    pub stale_ok: bool,
    pub cache_path: Option<PathBuf>,
    pub accept_partial: bool,
    pub watch: Option<WatchDelivery>,
    pub workers: Workers,
    pub batch_size: usize,
    pub order: ScanOrder,
}
Expand description

How a request is carried out, which never changes what its answer says.

No Default, deliberately. Every field here is a decision its caller has already made, and the cache policy is the one that decides whether an answer touches the filesystem and whether it leaves a trace; a default one reads cache: Auto whatever the caller asked for, which is exactly how the watch session came to validate against a cache policy nobody had chosen and WatchCacheOnly became unreachable inside the engine (fdu-i18y). A caller that wants the ordinary delivery names it.

Fields§

§cache: CachePolicy

How the snapshot cache may be used.

§stale_ok: bool

Answer from the snapshot alone, without touching the tree.

The one delivery whose answer can be stale, and it says so: the report’s provenance is cache_only and its freshness stale. It fails when no usable snapshot exists rather than quietly scanning, because a fast path that is sometimes a full walk, with nothing in the output to say which happened, is worse than none. It writes nothing, and it is refused with CachePolicy::Off, with a watch, and by a refresh, none of which can take an unverified snapshot as their answer.

§cache_path: Option<PathBuf>

Where the snapshot for this root lives, or None for no cache at all.

§accept_partial: bool

Whether a partial answer is accepted as a success.

§watch: Option<WatchDelivery>

Whether the answer repeats as a watch, and how.

§workers: Workers

Directory and content reader workers.

§batch_size: usize

Maximum operations in one scanner batch.

§order: ScanOrder

Directory traversal scheduling.

Implementations§

Source§

impl Delivery

Source

pub fn new(cache: CachePolicy, cache_path: Option<PathBuf>) -> Self

Ordinary execution settings with an explicitly chosen cache policy and location.

Source

pub fn stale_ok(cache_path: Option<PathBuf>) -> Self

Ordinary execution settings that answer from the snapshot at cache_path alone.

Source

pub fn enumerate() -> impl Iterator<Item = Self>

Representative deliveries for checking policy independently of route. Worker counts and cache location are fixed; every cache, stale-answer, partial-answer, and watch choice is represented.

Trait Implementations§

Source§

impl Clone for Delivery

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Delivery

Source§

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

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

impl Eq for Delivery

Source§

impl PartialEq for Delivery

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Delivery

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.