Stream: general

Topic: ✔ Inspect state of resource


view this post on Zulip Ari Seyhun (May 11 2022 at 12:05):

Given the following .wit file:

resource aggregate {
  static new: function(id: string) -> aggregate
  apply-events: function(events: list<list<u8>>) -> expected<unit, error>
  handle-command: function(command: list<u8>) -> expected<list<list<u8>>, error>
}

How could I inspect the state of the resource from wasmtime?

For example:

export!("domain.wit");

pub struct Aggregate {
  foo: i32
}

impl domain::Aggregate for Aggregate { ... }

How could I inspect foo after it's been compiled to wasm and running in wasmtime?

view this post on Zulip Alex Crichton (May 11 2022 at 14:55):

Resources are intended to be opaque handles so if wasm is providing a resource to the host then the host has no way to inspect the contents of the resource since that's an implementation detail of the wasm blob that the host doesn't know about.

view this post on Zulip Notification Bot (May 12 2022 at 04:47):

Ari Seyhun has marked this topic as resolved.


Last updated: Nov 22 2024 at 16:03 UTC