WithModuleInstance returns a Go context inheriting from ctx and containing the state needed for module instantiated from wazero host module to properly bind their methods to their receiver (e.g. the module instance). Use this function when calling methods of an instantiated WebAssenbly module which
(ctx context.Context, ins *ModuleInstance[T])
| 217 | // ... |
| 218 | // } |
| 219 | func WithModuleInstance[T Module](ctx context.Context, ins *ModuleInstance[T]) context.Context { |
| 220 | return context.WithValue(ctx, (*ModuleInstance[T])(nil), ins.instance) |
| 221 | } |
no outgoing calls