Module cap_async_std::fs
source · [−]Expand description
A capability-based filesystem API modeled after async_std::fs.
This corresponds to async_std::fs.
Instead of async_std::fs’s free functions and async_std::fs::File’s
constructors which operate on bare paths, this crate has methods on Dir
which operate on paths which must be relative to the directory.
Where async_std says “the filesystem”, this API says “a filesystem”, as
it doesn’t assume that there’s a single global filesystem namespace.
Since all functions which expose raw file descriptors are unsafe, I/O
handles in this API are unforgeable (unsafe code notwithstanding). This
combined with a lack of absolute paths provides a natural capability-based
interface.
This crate uses the existing async_std::path::Path rather than having its
own path type, however while async_std::path::Path is mostly just a pure
datatype, it includes aliases for several async_std::fs functions. To
preserve the capability-based interface, avoid using
async_std::path::Path’s canonicalize, read_link, read_dir,
metadata, and symlink_metadata functions.
Structs
ReadDir iterator.Traits
FileType.