Docs.rs
  • cap-async-std-3.4.4
    • cap-async-std 3.4.4
    • Permalink
    • Docs.rs crate page
    • Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • sunfishcode
    • wasmtime-publish
    • Dependencies
      • arf-strings ^0.7.0 normal optional
      • async-std ^1.13.0 normal
      • camino ^1.0.5 normal optional
      • cap-primitives ^3.4.4 normal
      • io-extras ^0.18.3 normal
      • io-lifetimes ^2.0.0 normal
      • rustix ^1.0.0 normal
    • Versions
    • 100% of the crate is documented
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate cap_async_std

logo

cap_async_std3.4.4

  • All Items

Crate Items

  • Re-exports
  • Modules
  • Structs
  • Functions

Crates

  • cap_async_std

Crate cap_async_std

Source
Expand description

A capability-based API modeled after async_std.

This corresponds to async_std.

Capability-based APIs represent access to external resources as values which can be passed around between different parts of a program.

Two notable features are the Dir and Pool types:

  • Dir represents an open directory in a filesystem. Instead of opening files by absolute paths or paths relative to the current working directory, files are opened via paths relative to a Dir. The concepts of a process-wide “current working directory” and a single global filesystem namespace are de-emphasized.
  • Pool represents a set of network addresses. Instead of allowing applications to request access to any address and then applying process-wide filtering rules, filtering rules are built into pools which may be passed through the program.

On WASI, use of this library closely reflects the underlying system API, so it avoids compatibility layers.

Re-exports§

pub use async_std;
pub use cap_primitives::ipnet;
pub use io_lifetimes;

Modules§

fs
A capability-based filesystem API modeled after async_std::fs.
net
A capability-based network API modeled after async_std::net.
os
OS-specific extensions.
time
A capability-based clock API modeled after std::time.

Structs§

AmbientAuthority
Instances of this AmbientAuthority type serve to indicate that the ambient_authority function has been called, indicating that the user has explicitly opted into using ambient authority.

Functions§

ambient_authority
Return an AmbientAuthority value, which allows use of functions that include an AmbientAuthority argument.

Results

Settings
Help
    struct
    cap_async_std::fs::Dir
    A reference to an open directory on a filesystem.
    method
    cap_async_std::fs::FileType::dir
    Creates a FileType for which is_dir() returns true.
    struct
    cap_async_std::fs::DirEntry
    Entries returned by the ReadDir iterator.
    struct
    cap_async_std::fs::DirBuilder
    A builder used to create directories in various manners.
    method
    cap_async_std::fs::Dir::dir_metadata
    Queries metadata about the underlying directory.
    trait
    cap_async_std::fs::DirBuilderExt
    Unix-specific extensions to [fs::DirBuilder].
    method
    cap_async_std::fs::Dir::is_dir
    Checks if path is a directory.
    method
    cap_async_std::fs::FileType::is_dir
    Tests whether this file type represents a directory.
    method
    cap_async_std::fs::Metadata::is_dir
    Returns true if this metadata is for a directory.
    struct
    cap_async_std::fs::ReadDir
    Iterator over the entries in a directory.
    method
    cap_async_std::fs::DirEntry::open_dir
    Open the entry as a directory.
    method
    cap_async_std::fs::Dir::open_dir
    Attempts to open a directory.
    method
    cap_async_std::fs::Dir::read_dir
    Returns an iterator over the entries within a directory.
    method
    cap_async_std::fs::Dir::create_dir
    Creates a new, empty directory at the provided path.
    method
    cap_async_std::fs::DirEntry::remove_dir
    Removes the directory from its filesystem.
    method
    cap_async_std::fs::Dir::remove_dir
    Removes an empty directory.
    method
    cap_async_std::fs::Dir::reopen_dir
    Construct a new instance of Self from existing directory …
    method
    cap_async_std::fs::Dir::create_dir_all
    Recursively create a directory and all of its parent …
    method
    cap_async_std::fs::Dir::remove_dir_all
    Removes a directory at this path, after removing all its …
    method
    cap_async_std::fs::Dir::create_dir_with
    Creates the specified directory with the options …
    method
    cap_async_std::fs::Dir::open_parent_dir
    Constructs a new instance of Self by opening the parent …
    method
    cap_async_std::fs::Dir::remove_open_dir
    Remove the directory referenced by self and consume self.
    method
    cap_async_std::fs::Dir::remove_open_dir_all
    Removes the directory referenced by self, after removing …
    method
    cap_async_std::fs::Dir::open_ambient_dir
    Constructs a new instance of Self by opening the given …
    method
    cap_async_std::fs::Dir::create_ambient_dir_all
    Recursively create a directory and all of its parent …
    method
    cap_async_std::time::Duration::div
    method
    cap_async_std::fs::Dir::into_raw_fd
    Dir -> RawFd
    method
    cap_async_std::fs::Dir::into_std_file
    Dir -> File
    Consumes self and returns an async_std::fs::File.
    method
    cap_async_std::fs::Dir::as_fd
    &Dir -> BorrowedFd
    method
    cap_async_std::fs::Dir::clone
    &Dir -> Dir
    method
    cap_async_std::fs::Dir::as_raw_fd
    &Dir -> RawFd
    method
    cap_async_std::fs::Dir::remove_open_dir
    Dir -> Result<()>
    Remove the directory referenced by self and consume self.
    method
    cap_async_std::fs::Dir::remove_open_dir_all
    Dir -> Result<()>
    Removes the directory referenced by self, after removing …
    method
    cap_async_std::fs::Dir::entries
    &Dir -> Result<ReadDir>
    Returns an iterator over the entries within self.
    method
    cap_async_std::fs::Dir::dir_metadata
    &Dir -> Result<Metadata>
    Queries metadata about the underlying directory.
    method
    cap_async_std::fs::Dir::open_parent_dir
    &Dir, AmbientAuthority -> Result<Dir>
    Constructs a new instance of Self by opening the parent …
    method
    cap_async_std::fs::Dir::fmt
    &Dir, &mut Formatter -> Result
    method
    cap_async_std::fs::Dir::exists
    &Dir, P -> bool
    Returns true if the path points at an existing entity.
    method
    cap_async_std::fs::Dir::is_dir
    &Dir, P -> bool
    Checks if path is a directory.
    method
    cap_async_std::fs::Dir::is_file
    &Dir, P -> bool
    Returns true if the path exists on disk and is pointing at …
    method
    cap_async_std::fs::Dir::open
    &Dir, P -> Result<File>
    Attempts to open a file in read-only mode.
    method
    cap_async_std::fs::Dir::create
    &Dir, P -> Result<File>
    Opens a file in write-only mode.
    method
    cap_async_std::fs::Dir::metadata
    &Dir, P -> Result<Metadata>
    Given a path, query the file system to get information …
    method
    cap_async_std::fs::Dir::open_dir
    &Dir, P -> Result<Dir>
    Attempts to open a directory.
    method
    cap_async_std::fs::Dir::read_dir
    &Dir, P -> Result<ReadDir>
    Returns an iterator over the entries within a directory.
    method
    cap_async_std::fs::Dir::read_link
    &Dir, P -> Result<PathBuf>
    Reads a symbolic link, returning the file that the link …
    method
    cap_async_std::fs::Dir::create_dir
    &Dir, P -> Result<()>
    Creates a new, empty directory at the provided path.
    method
    cap_async_std::fs::Dir::remove_dir
    &Dir, P -> Result<()>
    Removes an empty directory.
    method
    cap_async_std::fs::Dir::try_exists
    &Dir, P -> Result<bool>
    Returns true if the path points at an existing entity.
    method
    cap_async_std::fs::Dir::remove_file
    &Dir, P -> Result<()>
    Removes a file from a filesystem.
    method
    cap_async_std::fs::Dir::canonicalize
    &Dir, P -> Result<PathBuf>
    Returns the canonical form of a path with all intermediate …
    method
    cap_async_std::fs::Dir::create_dir_all
    &Dir, P -> Result<()>
    Recursively create a directory and all of its parent …
    method
    cap_async_std::fs::Dir::read_to_string
    &Dir, P -> Result<String>
    Read the entire contents of a file into a string.
    method
    cap_async_std::fs::Dir::remove_dir_all
    &Dir, P -> Result<()>
    Removes a directory at this path, after removing all its …
    method
    cap_async_std::fs::Dir::symlink_metadata
    &Dir, P -> Result<Metadata>
    Query the metadata about a file without following symlinks.
    method
    cap_async_std::fs::Dir::bind_unix_datagram
    &Dir, P -> Result<UnixDatagram>
    Creates a Unix datagram socket bound to the given path.
    method
    cap_async_std::fs::Dir::bind_unix_listener
    &Dir, P -> Result<UnixListener>
    Creates a new UnixListener bound to the specified socket.
    method
    cap_async_std::fs::Dir::connect_unix_stream
    &Dir, P -> Result<UnixStream>
    Connects to the socket named by path.
    method
    cap_async_std::fs::Dir::read
    &Dir, P -> Result<Vec<u8>>
    Read the entire contents of a file into a bytes vector.
    method
    cap_async_std::fs::Dir::set_permissions
    &Dir, P, Permissions -> Result<()>
    Changes the permissions found on a file or a directory.
    method
    cap_async_std::fs::Dir::open_with
    &Dir, P, &OpenOptions -> Result<File>
    Opens a file at path with the options specified by options.
    method
    cap_async_std::fs::Dir::create_dir_with
    &Dir, P, &DirBuilder -> Result<()>
    Creates the specified directory with the options …
    method
    cap_async_std::fs::Dir::connect_unix_datagram
    &Dir, &UnixDatagram, P -> Result<()>
    Connects the socket to the specified address.
    method
    cap_async_std::fs::Dir::symlink
    &Dir, P, Q -> Result<()>
    Creates a new symbolic link on a filesystem.
    method
    cap_async_std::fs::Dir::write
    &Dir, P, C -> Result<()>
    Write a slice as the entire contents of a file.
    method
    cap_async_std::fs::Dir::copy
    &Dir, P, &Dir, Q -> Result<u64>
    Copies the contents of one file to another. This function …
    method
    cap_async_std::fs::Dir::rename
    &Dir, P, &Dir, Q -> Result<()>
    Rename a file or directory to a new name, replacing the …
    method
    cap_async_std::fs::Dir::hard_link
    &Dir, P, &Dir, Q -> Result<()>
    Creates a new hard link on a filesystem.
    method
    cap_async_std::fs::Dir::send_to_unix_datagram_addr
    &Dir, &UnixDatagram, &[u8], P -> Result<usize>
    Sends data on the socket to the specified address.
    method
    cap_async_std::fs::Dir::from
    OwnedFd -> Dir
    method
    cap_async_std::fs::Dir::from_raw_fd
    RawFd -> Dir
    method
    cap_async_std::fs::Dir::from_std_file
    File -> Dir
    Constructs a new instance of Self from the given …
    method
    cap_async_std::fs::DirEntry::open_dir
    &DirEntry -> Result<Dir>
    Open the entry as a directory.
    method
    cap_async_std::fs::Dir::reopen_dir
    &Filelike -> Result<Dir>
    Construct a new instance of Self from existing directory …
    method
    cap_async_std::fs::Dir::open_ambient_dir
    P, AmbientAuthority -> Result<Dir>
    Constructs a new instance of Self by opening the given …
    method
    cap_async_std::fs::Dir::clone
    &Dir -> Dir
    method
    cap_async_std::fs::Dir::open_parent_dir
    &Dir, AmbientAuthority -> Result<Dir>
    Constructs a new instance of Self by opening the parent …
    method
    cap_async_std::fs::Dir::open_dir
    &Dir, P -> Result<Dir>
    Attempts to open a directory.