[][src]Module wasmer_wasi_fl::state

WARNING: the API exposed here is unstable and very experimental. Certain things are not ready yet and may be broken in patch releases. If you're using this and have any specific needs, please let us know here https://github.com/wasmerio/wasmer/issues/583 or by filing an issue.

Wasmer always has a virtual root directory located at / at which all pre-opened directories can be found. It's possible to traverse between preopened directories this way as well (for example preopen-dir1/../preopen-dir2).

A preopened directory is a directory or directory + name combination passed into the generate_import_object function. These are directories that the caller has given the WASI module permission to access.

You can implement WasiFile for your own types to get custom behavior and extend WASI, see the WASI plugin example.

Structs

Fd
HostFile

A thin wrapper around std::fs::File

Inode

An index (and generation) into an Arena.

InodeVal

A file that Wasi knows about that may or may not be open

PollEventBuilder
PollEventIter
PreopenDirBuilder

Builder for preopened directories.

Stderr

A wrapper type around Stderr that implements WasiFile and Serialize + Deserialize.

Stdin

A wrapper type around Stdin that implements WasiFile and Serialize + Deserialize.

Stdout

A wrapper type around Stdout that implements WasiFile and Serialize + Deserialize.

WasiFs

Warning, modifying these fields directly may cause invariants to break and should be considered unsafe. These fields may be made private in a future release

WasiState

Top level data type containing all* the state with which WASI can interact.

WasiStateBuilder

Convenient builder API for configuring WASI via WasiState.

Enums

Kind

The core of the filesystem abstraction. Includes directories, files, and symlinks.

PollEvent
WasiFsError

Error type for external users

WasiStateCreationError

Error type returned when bad data is given to WasiStateBuilder.

Constants

ALL_RIGHTS

all the rights enabled

MAX_SYMLINKS

A completely aribtrary "big enough" number used as the upper limit for the number of symlinks that can be traversed when resolving a path

VIRTUAL_ROOT_FD

the fd value of the virtual root

Traits

WasiFile

This trait relies on your file closing when it goes out of scope via Drop

WasiPath

Functions

get_wasi_state

Get WasiState from a Ctx

host_file_type_to_wasi_file_type
iterate_poll_events

Type Definitions

PollEventSet