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

Method get_string

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

\brief Returns the string value, only valid if `is_string()`.

Source from the content-addressed store, hash-verified

817
818 /// \brief Returns the string value, only valid if `is_string()`.
819 std::string_view get_string() const {
820 assert(is_string());
821 return std::string_view(raw.of.string.data, raw.of.string.size);
822 }
823
824 /// \brief Returns whether this value is a list.
825 bool is_list() const { return raw.kind == WASMTIME_COMPONENT_LIST; }

Callers 1

TESTFunction · 0.80

Calls 1

assertFunction · 0.85

Tested by 1

TESTFunction · 0.64