resource.mx raw

   1  package cm
   2  
   3  // Resource represents an opaque Component Model [resource handle].
   4  // It is represented in the [Canonical ABI] as an 32-bit integer.
   5  //
   6  // [resource handle]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md#handle-types
   7  // [Canonical ABI]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md
   8  type Resource uint32
   9  
  10  // Rep represents a Component Model [resource rep], the core representation type of a resource.
  11  // It is represented in the [Canonical ABI] as an 32-bit integer.
  12  //
  13  // [resource rep]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md#canon-resourcerep
  14  // [Canonical ABI]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md
  15  type Rep uint32
  16  
  17  // ResourceNone is a sentinel value indicating a null or uninitialized resource.
  18  // This is a reserved value specified in the [Canonical ABI runtime state].
  19  //
  20  // [Canonical ABI runtime state]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md#runtime-state
  21  const ResourceNone = 0
  22