#[non_exhaustive]pub struct LoadSettings { /* private fields */ }Expand description
Bounds and filters of a folder walk. Every field has a safe default:
the five text extensions, 10 000 files, 8 MiB per file, depth 16,
100 000 directory entries, symlinks not followed, hidden entries
skipped. Built with Default and the with_* setters.
Implementations§
Source§impl LoadSettings
impl LoadSettings
Sourcepub fn with_extensions<I, S>(self, extensions: I) -> LoadSettings
pub fn with_extensions<I, S>(self, extensions: I) -> LoadSettings
Sets the file extensions to load, compared without case.
Only txt, md, markdown, html and htm can be read; any
other extension in the list is still skipped.
Sourcepub fn with_max_files(self, max_files: usize) -> LoadSettings
pub fn with_max_files(self, max_files: usize) -> LoadSettings
Sets the most supported files one walk loads. A folder with more is an error, so a walk never stops halfway in silence. Default 10 000.
Sourcepub fn with_max_file_bytes(self, max_file_bytes: u64) -> LoadSettings
pub fn with_max_file_bytes(self, max_file_bytes: u64) -> LoadSettings
Sets the largest file in bytes. A larger file is an error that names the source, checked from metadata before any read. Default 8 MiB.
Sourcepub fn with_max_depth(self, max_depth: usize) -> LoadSettings
pub fn with_max_depth(self, max_depth: usize) -> LoadSettings
Sets the deepest folder level below the root, which is level 0. A folder deeper than this is an error that names it. Hidden folders are never entered, so they never trip it. Default 16.
Sourcepub fn with_max_entries(self, max_entries: usize) -> LoadSettings
pub fn with_max_entries(self, max_entries: usize) -> LoadSettings
Sets the most directory entries one walk visits, of any kind. It bounds a walk through big folders of unsupported files; more entries is an error. Default 100 000.
Sourcepub fn with_follow_symlinks(self, follow: bool) -> LoadSettings
pub fn with_follow_symlinks(self, follow: bool) -> LoadSettings
Sets whether symlinks are followed.
Off by default, because a link can point outside the folder the
user chose. A link not followed is counted in Walked.symlinks.
Sets whether entries whose name starts with a dot are skipped.
On by default, so .git and editor files stay out. A skipped
hidden entry is neither entered nor counted.
Sourcepub fn extensions(&self) -> &[String]
pub fn extensions(&self) -> &[String]
Returns the extensions loaded, lowercase.
Only the five readable text extensions can match a file.
Default txt, md, markdown, html, htm.
Sourcepub fn max_files(&self) -> usize
pub fn max_files(&self) -> usize
Returns the most supported files one walk loads. One more is an error naming the cap. Default 10 000.
Sourcepub fn max_file_bytes(&self) -> u64
pub fn max_file_bytes(&self) -> u64
Returns the largest file in bytes. A larger file is an error naming the source. Default 8 MiB.
Sourcepub fn max_depth(&self) -> usize
pub fn max_depth(&self) -> usize
Returns the deepest folder level walked. The root is level 0. Default 16.
Sourcepub fn max_entries(&self) -> usize
pub fn max_entries(&self) -> usize
Returns the most directory entries one walk visits. Every entry counts, hidden or not. Default 100 000.
Sourcepub fn follow_symlinks(&self) -> bool
pub fn follow_symlinks(&self) -> bool
Returns whether symlinks are followed. A followed link is loaded like the file it points to. Default false.
Returns whether hidden entries are skipped. A hidden entry starts with a dot. Default true.
Trait Implementations§
Source§impl Clone for LoadSettings
impl Clone for LoadSettings
Source§fn clone(&self) -> LoadSettings
fn clone(&self) -> LoadSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoadSettings
impl Debug for LoadSettings
Source§impl Default for LoadSettings
impl Default for LoadSettings
Source§fn default() -> LoadSettings
fn default() -> LoadSettings
impl Eq for LoadSettings
Source§impl PartialEq for LoadSettings
impl PartialEq for LoadSettings
impl StructuralPartialEq for LoadSettings
Auto Trait Implementations§
impl Forget for LoadSettings
impl Freeze for LoadSettings
impl Move for LoadSettings
impl RefUnwindSafe for LoadSettings
impl Send for LoadSettingswhere
RawVecInner: Send,
impl Sync for LoadSettingswhere
RawVecInner: Sync,
impl Unpin for LoadSettings
impl UnsafeUnpin for LoadSettings
impl UnwindSafe for LoadSettingswhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.