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

Method to_extern

crates/c-api/src/extern.rs:112–122  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

110
111impl wasmtime_extern_t {
112 pub unsafe fn to_extern(&self) -> Extern {
113 match self.kind {
114 WASMTIME_EXTERN_FUNC => Extern::Func(self.of.func),
115 WASMTIME_EXTERN_GLOBAL => Extern::Global(self.of.global),
116 WASMTIME_EXTERN_TABLE => Extern::Table(self.of.table),
117 WASMTIME_EXTERN_MEMORY => Extern::Memory(self.of.memory),
118 WASMTIME_EXTERN_SHAREDMEMORY => Extern::SharedMemory((**self.of.sharedmemory).clone()),
119 WASMTIME_EXTERN_TAG => Extern::Tag(self.of.tag),
120 other => panic!("unknown wasmtime_extern_kind_t: {other}"),
121 }
122 }
123}
124
125impl From<Extern> for wasmtime_extern_t {

Callers 3

wasmtime_instance_newFunction · 0.45
wasmtime_linker_defineFunction · 0.45
wasmtime_extern_typeFunction · 0.45

Calls 7

FuncClass · 0.50
GlobalClass · 0.50
TableClass · 0.50
MemoryClass · 0.50
SharedMemoryClass · 0.50
TagClass · 0.50
cloneMethod · 0.45

Tested by

no test coverage detected