MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / with_inner

Method with_inner

crates/tinywasm/src/store/memory/lazy.rs:35–39  ·  view source on GitHub ↗
(&self, f: impl FnOnce(&dyn LinearMemory) -> R)

Source from the content-addressed store, hash-verified

33 }
34
35 fn with_inner<R>(&self, f: impl FnOnce(&dyn LinearMemory) -> R) -> R {
36 self.ensure_materialized();
37 let inner = self.inner.borrow();
38 f(inner.as_deref().expect("lazy memory should be materialized"))
39 }
40
41 fn try_with_inner<R>(&self, f: impl FnOnce(&dyn LinearMemory) -> R) -> core::result::Result<R, crate::Trap> {
42 self.try_ensure_materialized()?;

Callers 4

lenMethod · 0.80
readMethod · 0.80
read_exactMethod · 0.80
read_vecMethod · 0.80

Calls 1

ensure_materializedMethod · 0.80

Tested by

no test coverage detected