Wasmtime
wasmtime::component::Map Class Reference

Class representing a component model map, a collection of key/value pairs. More...

#include <val.hh>

Public Member Functions

 Map (Raw &&capi)
 
 Map (const Map &other)
 Copy constructor to clone other.
More...
 
Mapoperator= (const Map &other)
 Copy assignment to clone from other.
More...
 
 Map (Map &&other)
 Move constructor to move the contents of other.
More...
 
Mapoperator= (Map &&other)
 Move assignment to move the contents of other.
More...
 
const Rawcapi () const
 Returns a pointer to the underlying C API representation.
More...
 
 Map (std::vector< std::pair< Val, Val > > entries)
 Creates a new map from the key/value pairs provided.
 
size_t size () const
 Returns the number of entries in the map.
 
const MapEntrybegin () const
 Returns an iterator to the beginning of the map entries.
 
const MapEntryend () const
 Returns an iterator to the end of the map entries.
 

Static Public Member Functions

static const Mapfrom_capi (const Raw *capi)
 
static Mapfrom_capi (Raw *capi)
 
static const Rawto_capi (const Map *capi)
 
static Rawto_capi (Map *capi)
 

Friends

class Val
 

Detailed Description

Class representing a component model map, a collection of key/value pairs.

Constructor & Destructor Documentation

◆ Map() [1/3]

wasmtime::component::Map::Map ( Raw &&  capi)
inlineexplicit
  • Create a variant that takes ownership of the underlying C API variant.

◆ Map() [2/3]

wasmtime::component::Map::Map ( const Map other)
inline

Copy constructor to clone other.

◆ Map() [3/3]

wasmtime::component::Map::Map ( Map &&  other)
inline

Move constructor to move the contents of other.

Member Function Documentation

◆ capi()

const Raw * wasmtime::component::Map::capi ( ) const
inline

Returns a pointer to the underlying C API representation.

◆ from_capi() [1/2]

static const Map * wasmtime::component::Map::from_capi ( const Raw capi)
inlinestatic
  • Converts the raw C API representation to this class without taking * ownership.

◆ from_capi() [2/2]

static Map * wasmtime::component::Map::from_capi ( Raw capi)
inlinestatic
  • Converts the raw C API representation to this class without taking * ownership.

◆ operator=() [1/2]

Map & wasmtime::component::Map::operator= ( const Map other)
inline

Copy assignment to clone from other.

◆ operator=() [2/2]

Map & wasmtime::component::Map::operator= ( Map &&  other)
inline

Move assignment to move the contents of other.

◆ to_capi() [1/2]

static const Raw * wasmtime::component::Map::to_capi ( const Map capi)
inlinestatic
  • Converts to the raw C API representation to this class without taking * ownership.

◆ to_capi() [2/2]

static Raw * wasmtime::component::Map::to_capi ( Map capi)
inlinestatic
  • Converts to the raw C API representation to this class without taking * ownership.

The documentation for this class was generated from the following file: