MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / env

Method env

crates/c-api/include/wasmtime/wasi.hh:47–55  ·  view source on GitHub ↗

Configures the environment variables available to wasm, specified here as a list of pairs where the first element of the pair is the key and the second element is the value.

Source from the content-addressed store, hash-verified

45 /// a list of pairs where the first element of the pair is the key and the
46 /// second element is the value.
47 void env(const std::vector<std::pair<std::string, std::string>> &env) {
48 std::vector<const char *> names;
49 std::vector<const char *> values;
50 for (const auto &[name, value] : env) {
51 names.push_back(name.c_str());
52 values.push_back(value.c_str());
53 }
54 wasi_config_set_env(ptr.get(), env.size(), names.data(), values.data());
55 }
56
57 /// Indicates that the entire environment of this process should be inherited
58 /// by the wasi configuration.

Callers 2

wasi_config_set_envFunction · 0.45
TESTFunction · 0.45

Calls 4

wasi_config_set_envFunction · 0.85
getMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by 1

TESTFunction · 0.36