Struct ScanOptions

Source
pub struct ScanOptions {
    pub force_read: bool,
    pub threads: usize,
    pub follow_symlinks: bool,
    pub skip_hidden: bool,
    pub excluded: Vec<PathBuf>,
    pub unavailable_roots: Vec<PathBuf>,
    pub same_artist: Vec<Chosen>,
}
Expand description

Knobs governing a traversal. Default gives the settings suited to a personal library: automatic parallelism, no symlink following, hidden entries left alone.

Fields§

§force_read: bool

Read every accessible file again while retaining the previous catalog as evidence for inaccessible paths. This does not discard cached data merely because a watched drive or subfolder cannot be read.

§threads: usize

Number of reader threads. 0 = automatic detection.

§follow_symlinks: bool

Follow symbolic links (with loop detection).

§skip_hidden: bool

Skip files and folders starting with a dot.

§excluded: Vec<PathBuf>

Folders never to walk into, canonical, whatever a root says.

A music folder is rarely only music: Audiobooks, Podcasts, _incoming, a Samples folder for a DAW. Without this the only way to keep them out of the catalog is to reorganise the disk to suit the program, which is the wrong way round.

They live in the catalog, not in this run’s options, because a plain aede scan re-reads every watched root: an exclusion that had to be retyped would be forgotten exactly when it mattered.

§unavailable_roots: Vec<PathBuf>

Roots explicitly known to be unmounted, even when an empty mountpoint remains.

§same_artist: Vec<Chosen>

Spellings the owner of the disk has said are one artist.

The half of artist identity no identifier can settle, and the reason it travels here rather than in the catalog: it is the user’s, it lives in user.json, and this crate does not read that file — the caller does, as it does for every other statement in it.

It is applied when the graph is built, which is why a merge takes effect on the next aede scan and not before: the spelling a track is filed under is decided as the artist is interned, and there is no later moment at which one row can become another without rebuilding everything that points at it.

Trait Implementations§

Source§

impl Clone for ScanOptions

Source§

fn clone(&self) -> ScanOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ScanOptions

Source§

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

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

impl Default for ScanOptions

Source§

fn default() -> Self

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

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.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

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.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,