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

Method build

crates/wasi/src/ctx.rs:453–473  ·  view source on GitHub ↗

Uses the configured context so far to construct the final [`WasiCtx`]. Note that each `WasiCtxBuilder` can only be used to "build" once, and calling this method twice will panic. # Panics Panics if this method is called twice. Each [`WasiCtxBuilder`] can be used to create only a single [`WasiCtx`]. Repeated usage of this method is not allowed and should use a second builder instead.

(&mut self)

Source from the content-addressed store, hash-verified

451 /// used to create only a single [`WasiCtx`]. Repeated usage of this method
452 /// is not allowed and should use a second builder instead.
453 pub fn build(&mut self) -> WasiCtx {
454 assert!(!self.built);
455
456 let Self {
457 cli,
458 clocks,
459 filesystem,
460 random,
461 sockets,
462 built: _,
463 } = mem::replace(self, Self::new());
464 self.built = true;
465
466 WasiCtx {
467 cli,
468 clocks,
469 filesystem,
470 random,
471 sockets,
472 }
473 }
474 /// Builds a WASIp1 context instead of a [`WasiCtx`].
475 ///
476 /// This method is the same as [`build`](WasiCtxBuilder::build) but it

Callers 15

store_limitsMethod · 0.45
build_capstoneFunction · 0.45
executeMethod · 0.45
new_storeMethod · 0.45
inferMethod · 0.45
executeMethod · 0.45
executeMethod · 0.45
populate_with_wasiMethod · 0.45
set_legacy_p1_ctxMethod · 0.45
test_limitsFunction · 0.45
test_limits_memory_onlyFunction · 0.45

Calls 2

replaceFunction · 0.50
newFunction · 0.50

Tested by 15

test_limitsFunction · 0.36
test_limits_memory_onlyFunction · 0.36
test_limits_table_onlyFunction · 0.36
child_processFunction · 0.36
p2_api_timeFunction · 0.36
p2_api_read_onlyFunction · 0.36
p2_api_reactorFunction · 0.36
runFunction · 0.36