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

Method get_enum

crates/c-api/include/wasmtime/component/val.hh:873–876  ·  view source on GitHub ↗

\brief Returns the enum discriminant, only valid if `is_enum()`.

Source from the content-addressed store, hash-verified

871
872 /// \brief Returns the enum discriminant, only valid if `is_enum()`.
873 std::string_view get_enum() const {
874 assert(is_enum());
875 return std::string_view(raw.of.enumeration.data, raw.of.enumeration.size);
876 }
877
878 /// \brief Returns whether this value is a result.
879 bool is_result() const { return raw.kind == WASMTIME_COMPONENT_RESULT; }

Callers 1

TESTFunction · 0.80

Calls 1

assertFunction · 0.85

Tested by 1

TESTFunction · 0.64