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

Method exported_globals

crates/fuzzing/src/oracles/diff_wasmtime.rs:110–128  ·  view source on GitHub ↗

Returns the list of globals and their types exported from this instance.

(&mut self)

Source from the content-addressed store, hash-verified

108
109 /// Returns the list of globals and their types exported from this instance.
110 pub fn exported_globals(&mut self) -> Vec<(String, DiffValueType)> {
111 let globals = self
112 .instance
113 .exports(&mut self.store)
114 .filter_map(|e| {
115 let name = e.name();
116 e.into_global().map(|g| (name.to_string(), g))
117 })
118 .collect::<Vec<_>>();
119
120 globals
121 .into_iter()
122 .filter_map(|(name, global)| {
123 DiffValueType::try_from(global.ty(&self.store).content().clone())
124 .map(|ty| (name, ty))
125 .ok()
126 })
127 .collect()
128 }
129
130 /// Returns the list of exported memories and whether or not it's a shared
131 /// memory.

Callers 1

differentialFunction · 0.80

Calls 11

into_globalMethod · 0.80
collectMethod · 0.80
exportsMethod · 0.45
nameMethod · 0.45
mapMethod · 0.45
to_stringMethod · 0.45
into_iterMethod · 0.45
okMethod · 0.45
cloneMethod · 0.45
contentMethod · 0.45
tyMethod · 0.45

Tested by

no test coverage detected