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

Method try_with_inner

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

Source from the content-addressed store, hash-verified

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()?;
43 let inner = self.inner.borrow();
44 Ok(f(inner.as_deref().expect("lazy memory should be materialized")))
45 }
46
47 fn with_inner_mut<R>(&self, f: impl FnOnce(&mut dyn LinearMemory) -> R) -> R {
48 self.ensure_materialized();

Callers 5

read_8Method · 0.80
read_16Method · 0.80
read_32Method · 0.80
read_64Method · 0.80
read_128Method · 0.80

Calls 1

Tested by

no test coverage detected