usecrate::errors::{Error, ErrorKind}; use std::ffi::OsString; use std::fs::{FileType, Metadata}; use std::io; use std::path::{Path, PathBuf}; use std::task::{ready, Context, Poll}; use tokio::fs;
/// Wrapper for [`tokio::fs::read_dir`]. #[cfg_attr(docsrs, doc(cfg(feature = "tokio")))] pubasyncfn read_dir(path: impl AsRef<Path>) -> io::Result<ReadDir> { let path = path.as_ref(); let tokio = fs::read_dir(path)
.await
.map_err(|err| Error::build(err, ErrorKind::ReadDir, path))?;
Ok(ReadDir {
tokio,
path: path.to_owned(),
})
}
/// Reads the entries in a directory. /// /// This is a wrapper around [`tokio::fs::ReadDir`]. #[derive(Debug)] #[must_use = "streams do nothing unless polled"] #[cfg_attr(docsrs, doc(cfg(feature = "tokio")))] pubstruct ReadDir {
tokio: fs::ReadDir,
path: PathBuf,
}
/// Entries returned by the [`ReadDir`] stream. /// /// This is a wrapper around [`tokio::fs::DirEntry`]. #[derive(Debug)] #[cfg_attr(docsrs, doc(cfg(feature = "tokio")))] pubstruct DirEntry {
tokio: fs::DirEntry,
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.