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

Method cases

crates/wasmtime/src/runtime/component/types.rs:448–456  ·  view source on GitHub ↗

Retrieve the cases of this `variant` in declaration order.

(&self)

Source from the content-addressed store, hash-verified

446
447 /// Retrieve the cases of this `variant` in declaration order.
448 pub fn cases(&self) -> impl ExactSizeIterator<Item = Case<'_>> {
449 self.0.types[self.0.index]
450 .cases
451 .iter()
452 .map(|(name, ty)| Case {
453 name,
454 ty: ty.as_ref().map(|ty| Type::from(ty, &self.0.instance())),
455 })
456 }
457}
458
459impl PartialEq for Variant {

Callers 6

introspectionFunction · 0.80
variant_casesMethod · 0.80
ensure_type_valFunction · 0.80
arbitrary_valFunction · 0.80

Calls 5

fromFunction · 0.85
mapMethod · 0.45
iterMethod · 0.45
as_refMethod · 0.45
instanceMethod · 0.45

Tested by 1

introspectionFunction · 0.64