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

Method ref_

crates/wasmtime/src/runtime/values.rs:379–388  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

377 /// Get this value's underlying reference, if any.
378 #[inline]
379 pub fn ref_(self) -> Option<Ref> {
380 match self {
381 Val::FuncRef(f) => Some(Ref::Func(f)),
382 Val::ExternRef(e) => Some(Ref::Extern(e)),
383 Val::AnyRef(a) => Some(Ref::Any(a)),
384 Val::ExnRef(e) => Some(Ref::Exn(e)),
385 Val::I32(_) | Val::I64(_) | Val::F32(_) | Val::F64(_) | Val::V128(_) => None,
386 Val::ContRef(_) => None, // TODO(#10248): Return proper Ref::Cont when available
387 }
388 }
389
390 /// Attempt to access the underlying `externref` value of this `Val`.
391 ///

Callers 7

cross_storeFunction · 0.80
table_set_elementMethod · 0.80
default_valueMethod · 0.80
wasmtime_table_newFunction · 0.80
wasmtime_table_setFunction · 0.80
wasmtime_table_growFunction · 0.80
make_api_callsFunction · 0.80

Calls 2

FuncClass · 0.70
ExternEnum · 0.70

Tested by

no test coverage detected