Wasmtime
wasmtime::component::Record Class Reference

Class representing a component model record, a list of name/value pairs. More...

#include <val.hh>

Public Member Functions

 Record (Raw &&capi)
 
 Record (const Record &other)
 Copy constructor to clone other.
More...
 
Record & operator= (const Record &other)
 Copy assignment to clone from other.
More...
 
 Record (Record &&other)
 Move constructor to move the contents of other.
More...
 
Record & operator= (Record &&other)
 Move assignment to move the contents of other.
More...
 
const Raw * capi () const
 Returns a pointer to the underlying C API representation.
More...
 
 Record (std::vector< std::pair< std::string_view, Val > > entries)
 Creates a new record from the named field pairs provided.
 
size_t size () const
 Returns the number of entries in the record.
 
const RecordField * begin () const
 Returns an iterator to the beginning of the record fields.
 
const RecordField * end () const
 Returns an iterator to the end of the record fields.
 

Static Public Member Functions

static const Record * from_capi (const Raw *capi)
 
static Record * from_capi (Raw *capi)
 
static const Raw * to_capi (const Record *capi)
 
static Raw * to_capi (Record *capi)
 

Friends

class Val
 

Detailed Description

Class representing a component model record, a list of name/value pairs.

Constructor & Destructor Documentation

◆ Record() [1/3]

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

◆ Record() [2/3]

wasmtime::component::Record::Record ( const Record &  other)
inline

Copy constructor to clone other.

◆ Record() [3/3]

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

Move constructor to move the contents of other.

Member Function Documentation

◆ capi()

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

Returns a pointer to the underlying C API representation.

◆ from_capi() [1/2]

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

◆ from_capi() [2/2]

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

◆ operator=() [1/2]

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

Copy assignment to clone from other.

◆ operator=() [2/2]

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

Move assignment to move the contents of other.

◆ to_capi() [1/2]

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

◆ to_capi() [2/2]

static Raw * wasmtime::component::Record::to_capi ( Record *  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: