Struct wasmer_wasi_asml_fork::WasiState[][src]

pub struct WasiState {
    pub fs: WasiFs,
    pub args: Vec<Vec<u8>>,
    pub envs: Vec<Vec<u8>>,
}
Expand description

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

  • The contents of files are not stored and may be modified by other, concurrently running programs. Data such as the contents of directories are lazily loaded.

Usage:

WasiState::new("program_name")
   .env(b"HOME", "/home/home".to_string())
   .arg("--help")
   .envs({
       let mut hm = std::collections::HashMap::new();
       hm.insert("COLOR_OUTPUT", "TRUE");
       hm.insert("PATH", "/usr/bin");
       hm
   })
   .args(&["--verbose", "list"])
   .preopen(|p| p.directory("src").read(true).write(true).create(true))?
   .preopen(|p| p.directory(".").alias("dot").read(true))?
   .build()?;

Fields

fs: WasiFsargs: Vec<Vec<u8>>envs: Vec<Vec<u8>>

Implementations

Create a WasiStateBuilder to construct a validated instance of WasiState.

Turn the WasiState into bytes

Get a WasiState from bytes

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type for metadata in pointers and references to Self.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more