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

Method field

crates/wasmtime/src/runtime/types.rs:1971–1977  ·  view source on GitHub ↗

Get the `i`th field type. Returns `None` if `i` is out of bounds.

(&self, i: usize)

Source from the content-addressed store, hash-verified

1969 ///
1970 /// Returns `None` if `i` is out of bounds.
1971 pub fn field(&self, i: usize) -> Option<FieldType> {
1972 let engine = self.engine();
1973 self.as_wasm_struct_type()
1974 .fields
1975 .get(i)
1976 .map(|ty| FieldType::from_wasm_field_type(engine, ty))
1977 }
1978
1979 /// Returns the list of field types for this function.
1980 #[inline]

Callers 15

fmtMethod · 0.45
miri_gc_smoke_testFunction · 0.45
struct_field_simpleFunction · 0.45
struct_set_field_simpleFunction · 0.45
fmtMethod · 0.45
fmtMethod · 0.45
fmtMethod · 0.45
fmtMethod · 0.45
fmtMethod · 0.45
fmtMethod · 0.45
fmtMethod · 0.45

Calls 5

as_wasm_struct_typeMethod · 0.80
as_wasm_exn_typeMethod · 0.80
engineMethod · 0.45
mapMethod · 0.45
getMethod · 0.45

Tested by 3

struct_field_simpleFunction · 0.36
struct_set_field_simpleFunction · 0.36