Sha256: 900b90657c64f10b62177163cc37bcf5a2644c6e52bcef561779d59f43ee9711

Contents?: true

Size: 1.61 KB

Versions: 20

Compression:

Stored size: 1.61 KB

Contents

//! A capability-based filesystem API modeled after [`std::fs`].
//!
//! This corresponds to [`std::fs`].
//!
//! Instead of [`std::fs`'s free functions] and [`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 `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 `std::path::Path` rather than having its own
//! path type, however while `std::path::Path` is mostly just a pure datatype,
//! it includes aliases for several `std::fs` functions. To preserve the
//! capability-based interface, avoid using `std::path::Path`'s `canonicalize`,
//! `read_link`, `read_dir`, `metadata`, and `symlink_metadata` functions.
//!
//! [`std::fs`'s free functions]: https://doc.rust-lang.org/std/fs/#functions

mod dir;
mod dir_entry;
mod file;
mod read_dir;

pub use dir::Dir;
pub use dir_entry::DirEntry;
pub use file::File;
pub use read_dir::ReadDir;

// Re-export types from `cap_primitives`.
pub use cap_primitives::fs::{DirBuilder, FileType, Metadata, OpenOptions, Permissions};

// Re-export conditional types from `cap_primitives`.
#[cfg(any(unix, target_os = "vxworks", all(windows, windows_file_type_ext)))]
pub use cap_primitives::fs::FileTypeExt;

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
wasmtime-18.0.3 ./ext/cargo-vendor/cap-std-2.0.1/src/fs/mod.rs
wasmtime-17.0.1 ./ext/cargo-vendor/cap-std-2.0.1/src/fs/mod.rs
wasmtime-17.0.0 ./ext/cargo-vendor/cap-std-2.0.1/src/fs/mod.rs
wasmtime-16.0.0 ./ext/cargo-vendor/cap-std-2.0.1/src/fs/mod.rs
wasmtime-15.0.1 ./ext/cargo-vendor/cap-std-2.0.1/src/fs/mod.rs
wasmtime-15.0.0 ./ext/cargo-vendor/cap-std-2.0.1/src/fs/mod.rs
wasmtime-14.0.4 ./ext/cargo-vendor/cap-std-2.0.0/src/fs/mod.rs
wasmtime-14.0.3 ./ext/cargo-vendor/cap-std-2.0.0/src/fs/mod.rs
wasmtime-14.0.1 ./ext/cargo-vendor/cap-std-2.0.0/src/fs/mod.rs
wasmtime-14.0.0 ./ext/cargo-vendor/cap-std-2.0.0/src/fs/mod.rs
wasmtime-13.0.0 ./ext/cargo-vendor/cap-std-2.0.0/src/fs/mod.rs
wasmtime-12.0.1 ./ext/cargo-vendor/cap-std-2.0.0/src/fs/mod.rs
wasmtime-12.0.0 ./ext/cargo-vendor/cap-std-2.0.0/src/fs/mod.rs
wasmtime-11.0.0 ./ext/cargo-vendor/cap-std-1.0.15/src/fs/mod.rs
wasmtime-10.0.1 ./ext/cargo-vendor/cap-std-1.0.15/src/fs/mod.rs
wasmtime-10.0.0 ./ext/cargo-vendor/cap-std-1.0.15/src/fs/mod.rs
wasmtime-9.0.4 ./ext/cargo-vendor/cap-std-1.0.15/src/fs/mod.rs
wasmtime-9.0.1 ./ext/cargo-vendor/cap-std-1.0.15/src/fs/mod.rs
wasmtime-8.0.0 ./ext/cargo-vendor/cap-std-1.0.14/src/fs/mod.rs
wasmtime-7.0.0 ./ext/cargo-vendor/cap-std-1.0.9/src/fs/mod.rs