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

Method iter

crates/wasmtime/src/runtime/linker.rs:1254–1270  ·  view source on GitHub ↗

Returns an iterator over all items defined in this `Linker`, in arbitrary order. The iterator returned will yield 3-tuples where the first two elements are the module name and item name for the external item, and the third item is the item itself that is defined. Note that multiple `Extern` items may be defined for the same module/name pair. # Panics This function will panic if the `store` pro

(
        &'a self,
        mut store: impl AsContextMut<Data = T> + 'p,
    )

Source from the content-addressed store, hash-verified

1252 /// This function will panic if the `store` provided does not come from the
1253 /// same [`Engine`] that this linker was created with.
1254 pub fn iter<'a: 'p, 'p>(
1255 &'a self,
1256 mut store: impl AsContextMut<Data = T> + 'p,
1257 ) -> impl Iterator<Item = (&'a str, &'a str, Extern)> + 'p
1258 where
1259 T: 'static,
1260 {
1261 self.map.iter().map(move |(key, item)| {
1262 let store = store.as_context_mut();
1263 (
1264 &self.pool[key.module],
1265 &self.pool[key.name.unwrap()],
1266 // Should be safe since `T` is connecting the linker and store
1267 unsafe { item.to_extern(store.0).panic_on_oom() },
1268 )
1269 })
1270 }
1271
1272 /// Looks up a previously defined value in this [`Linker`], identified by
1273 /// the names provided.

Callers 15

get_allMethod · 0.45
valFunction · 0.45
match_valFunction · 0.45
perform_actionMethod · 0.45
assert_returnMethod · 0.45
run_wastMethod · 0.45
run_directiveMethod · 0.45
match_v128Function · 0.45
deterministicFunction · 0.45
envsMethod · 0.45
argsMethod · 0.45

Calls 5

panic_on_oomMethod · 0.80
mapMethod · 0.45
as_context_mutMethod · 0.45
unwrapMethod · 0.45
to_externMethod · 0.45

Tested by 4

deterministicFunction · 0.36
fp16Function · 0.36
mainFunction · 0.36
deterministicFunction · 0.36