Module sync

Source
Available on crate feature sync only.
Expand description

The wasi-cap-std-sync crate provides impl of WasiFile and WasiDir in terms of cap_std::fs::{File, Dir}. These types provide sandboxed access to the local filesystem on both Unix and Windows.

All syscalls are hidden behind the cap-std hierarchy, with the lone exception of the sched implementation, which is provided for both unix and windows in separate modules.

Any wasi_common::{WasiCtx, WasiCtxBuilder} is interoperable with the implementations provided in wasi_common::sync. However, for convenience, this module provides its own WasiCtxBuilder that hooks up to all of the crate’s components, i.e. it fills in all of the arguments to WasiCtx::builder(...), presents preopen_dir in terms of cap_std::fs::Dir, and provides convenience methods for inheriting the parent process’s stdio, args, and env.

Re-exports§

pub use clocks::clocks_ctx;
pub use sched::sched_ctx;

Modules§

clocks
dir
file
net
sched
snapshots
stdio

Structs§

Dir
A reference to an open directory on a filesystem.
TcpListener
A TCP socket server, listening for connections.
WasiCtxBuilder

Functions§

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