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

Method new

crates/wasmtime/src/runtime/component/func/options.rs:58–77  ·  view source on GitHub ↗

Creates a new lowering context from the specified parameters.

(
        store: StoreContextMut<'a, T>,
        options: OptionsIndex,
        instance: Instance,
    )

Source from the content-addressed store, hash-verified

56impl<'a, T: 'static> LowerContext<'a, T> {
57 /// Creates a new lowering context from the specified parameters.
58 pub fn new(
59 store: StoreContextMut<'a, T>,
60 options: OptionsIndex,
61 instance: Instance,
62 ) -> LowerContext<'a, T> {
63 // Debug-assert that if we can't block that blocking is indeed allowed.
64 // This'll catch when this is accidentally created outside of a fiber
65 // when we need to be on a fiber.
66 if cfg!(debug_assertions) && !store.0.can_block() {
67 store.0.validate_sync_call().unwrap();
68 }
69 let (component, store) = instance.component_and_store_mut(store.0);
70 LowerContext {
71 store: StoreContextMut(store),
72 options,
73 types: component.types(),
74 instance,
75 allow_realloc: true,
76 }
77 }
78
79 /// Like `new`, except disallows use of `options.realloc`.
80 ///

Callers

nothing calls this directly

Calls 11

StoreContextMutClass · 0.85
validate_sync_callMethod · 0.80
hostcall_fuelMethod · 0.80
options_memoryMethod · 0.80
lift_context_partsMethod · 0.80
component_and_selfMethod · 0.80
can_blockMethod · 0.45
unwrapMethod · 0.45
typesMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected