Wasmtime
wasmtime::component::WitOption Class Reference

Class representing a component model option value. More...

#include <val.hh>

Public Member Functions

 WitOption (Raw &&capi)
 
 WitOption (const WitOption &other)
 Copy constructor to clone other.
More...
 
WitOptionoperator= (const WitOption &other)
 Copy assignment to clone from other.
More...
 
 WitOption (WitOption &&other)
 Move constructor to move the contents of other.
More...
 
WitOptionoperator= (WitOption &&other)
 Move assignment to move the contents of other.
More...
 
const Rawcapi () const
 Returns a pointer to the underlying C API representation.
More...
 
 WitOption (std::optional< Val > val)
 Constructs a new option value with the provided value.
 
const Valvalue () const
 Returns the optional payload value associated with this option.
 

Static Public Member Functions

static const WitOptionfrom_capi (const Raw *capi)
 
static WitOptionfrom_capi (Raw *capi)
 
static const Rawto_capi (const WitOption *capi)
 
static Rawto_capi (WitOption *capi)
 

Friends

class Val
 

Detailed Description

Class representing a component model option value.

Constructor & Destructor Documentation

◆ WitOption() [1/3]

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

◆ WitOption() [2/3]

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

Copy constructor to clone other.

◆ WitOption() [3/3]

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

Move constructor to move the contents of other.

Member Function Documentation

◆ capi()

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

Returns a pointer to the underlying C API representation.

◆ from_capi() [1/2]

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

◆ from_capi() [2/2]

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

◆ operator=() [1/2]

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

Copy assignment to clone from other.

◆ operator=() [2/2]

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

Move assignment to move the contents of other.

◆ to_capi() [1/2]

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

◆ to_capi() [2/2]

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