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

Function into_inner

tests/all/store.rs:5–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4#[test]
5fn into_inner() {
6 static HITS: AtomicUsize = AtomicUsize::new(0);
7
8 struct A;
9
10 impl Drop for A {
11 fn drop(&mut self) {
12 HITS.fetch_add(1, SeqCst);
13 }
14 }
15
16 let engine = Engine::default();
17 assert_eq!(HITS.load(SeqCst), 0);
18 drop(Store::new(&engine, A));
19 assert_eq!(HITS.load(SeqCst), 1);
20 Store::new(&engine, A).into_data();
21 assert_eq!(HITS.load(SeqCst), 2);
22}

Callers 6

cli_serve_hello_worldFunction · 0.85
cli_serve_sleepFunction · 0.85
try_into_innerMethod · 0.85
try_into_innerMethod · 0.85
poll_frameMethod · 0.85
try_intoMethod · 0.85

Calls 3

into_dataMethod · 0.80
newFunction · 0.50
dropFunction · 0.50

Tested by

no test coverage detected