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

Method ensure_materialized

crates/tinywasm/src/store/memory/lazy.rs:62–69  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

60 }
61
62 fn ensure_materialized(&self) {
63 if self.inner.borrow().is_some() {
64 return;
65 }
66
67 let storage = self.backend.create(self.ty, self.initial_len).expect("lazy memory materialization failed");
68 *self.inner.borrow_mut() = Some(storage.0);
69 }
70
71 fn try_ensure_materialized(&self) -> core::result::Result<(), crate::Trap> {
72 if self.inner.borrow().is_some() {

Callers 2

with_innerMethod · 0.80
with_inner_mutMethod · 0.80

Calls 1

createMethod · 0.80

Tested by

no test coverage detected