pub struct ReadDir {
pub files: bool,
pub dirs: bool,
pub recursive: bool,
pub root: bool,
}Expand description
Read a directory or file into a Vec
Fields§
§files: boolinclude files
dirs: boolinclude directories
recursive: boolsearch subdirectories
root: boolinclude the root directory
Implementations§
Source§impl ReadDir
impl ReadDir
Sourcepub fn all(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub fn all(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Get all files and directories in a directory, not recursive
Sourcepub async fn all_async(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub async fn all_async(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Async: Get all files and directories in a directory, not recursive
Sourcepub fn dirs(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub fn dirs(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Get all dirs in a directory, not recursive
Sourcepub async fn dirs_async(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub async fn dirs_async(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Async: Get all dirs in a directory, not recursive
Sourcepub fn files(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub fn files(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Get all files in a directory, not recursive
Sourcepub async fn files_async(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub async fn files_async(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Async: Get all files in a directory, not recursive
Sourcepub fn all_recursive(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub fn all_recursive(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Get all files and directories recursively
Sourcepub async fn all_recursive_async(
root: impl AsRef<Path>,
) -> FsResult<Vec<PathBuf>>
pub async fn all_recursive_async( root: impl AsRef<Path>, ) -> FsResult<Vec<PathBuf>>
Async: Get all files and directories recursively
Sourcepub fn dirs_recursive(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub fn dirs_recursive(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Get all subdirectories recursively
Sourcepub async fn dirs_recursive_async(
root: impl AsRef<Path>,
) -> FsResult<Vec<PathBuf>>
pub async fn dirs_recursive_async( root: impl AsRef<Path>, ) -> FsResult<Vec<PathBuf>>
Async: Get all subdirectories recursively
Sourcepub fn files_recursive(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub fn files_recursive(root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Get all files recursively
Sourcepub async fn files_recursive_async(
root: impl AsRef<Path>,
) -> FsResult<Vec<PathBuf>>
pub async fn files_recursive_async( root: impl AsRef<Path>, ) -> FsResult<Vec<PathBuf>>
Async: Get all files recursively
Sourcepub fn read(&self, root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub fn read(&self, root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Read dir with the provided options. if the root is a file, the file will be returned.
Sourcepub async fn read_async(&self, root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
pub async fn read_async(&self, root: impl AsRef<Path>) -> FsResult<Vec<PathBuf>>
Async version: Read dir with the provided options. if the root is a file, the file will be returned.
Sourcepub fn read_dirs_ok(
&self,
paths: impl IntoIterator<Item = impl AsRef<Path>>,
) -> FsResult<Vec<PathBuf>>
pub fn read_dirs_ok( &self, paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> FsResult<Vec<PathBuf>>
Read dir recursive for each path, ignoring DirNotFound errors
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReadDir
impl RefUnwindSafe for ReadDir
impl Send for ReadDir
impl Sync for ReadDir
impl Unpin for ReadDir
impl UnsafeUnpin for ReadDir
impl UnwindSafe for ReadDir
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> Xtend for T
impl<T> Xtend for T
Source§fn xmap<O>(self, func: impl FnOnce(Self) -> O) -> O
fn xmap<O>(self, func: impl FnOnce(Self) -> O) -> O
Iterator::map but for any type, not just iterators,
allowing for method chaining.Source§fn xtap(self, func: impl FnOnce(&mut Self)) -> Self
fn xtap(self, func: impl FnOnce(&mut Self)) -> Self
Iterator::inspect but for any type, not just iterators.Source§fn xprint_debug(self) -> Selfwhere
Self: Debug,
fn xprint_debug(self) -> Selfwhere
Self: Debug,
Source§fn xprint_debug_formatted(self, prefix: impl AsRef<str>) -> Selfwhere
Self: Debug,
fn xprint_debug_formatted(self, prefix: impl AsRef<str>) -> Selfwhere
Self: Debug,
Source§fn xtap_mut(&mut self, func: impl FnOnce(&mut Self)) -> &mut Self
fn xtap_mut(&mut self, func: impl FnOnce(&mut Self)) -> &mut Self
Iterator::inspect but for any type, not just iterators, and mutable.Source§fn xpipe<P: Pipeline<Self, O>, O>(self, pipeline: P) -> O
fn xpipe<P: Pipeline<Self, O>, O>(self, pipeline: P) -> O
Iterator::map but for any type, not just iterators,
using a custom Pipeline trait which behaves similarly to a FnOnce trait,
but available on stable rust.Source§fn xmut(&mut self) -> &mut Self
fn xmut(&mut self) -> &mut Self
&mut self in method chaining contexts.