diff --git a/examples/host-side/src/main.rs b/examples/host-side/src/main.rs index 773c59a..1c40297 100644 --- a/examples/host-side/src/main.rs +++ b/examples/host-side/src/main.rs @@ -43,7 +43,7 @@ async fn main() -> Result<()> { let tx = container.tx.clone(); let rx = container.rx.clone(); async_std::task::spawn(async move { - container.run().await.unwrap(); + container.run().unwrap(); }); while let Ok(msg) = rx.recv() { diff --git a/packages/vm/src/runtime.rs b/packages/vm/src/runtime.rs index 86834a6..f2f619f 100644 --- a/packages/vm/src/runtime.rs +++ b/packages/vm/src/runtime.rs @@ -8,9 +8,9 @@ use wasmtime::{ component::{Component, Linker}, Config, Engine, Store, }; -use wasmtime_wasi::preview2::{ +use wasmtime_wasi::{ command::{self, sync::Command}, - Table, WasiCtx, WasiCtxBuilder, WasiView, + ResourceTable, WasiCtx, WasiCtxBuilder, WasiView, }; use wit_component::ComponentEncoder; @@ -24,20 +24,14 @@ lazy_static! { pub struct WasiContext { wasi: WasiCtx, - table: Table, + table: ResourceTable, } impl WasiView for WasiContext { - fn ctx(&self) -> &WasiCtx { - &self.wasi - } - fn ctx_mut(&mut self) -> &mut WasiCtx { + fn ctx(&mut self) -> &mut WasiCtx { &mut self.wasi } - fn table(&self) -> &Table { - &self.table - } - fn table_mut(&mut self) -> &mut Table { + fn table(&mut self) -> &mut ResourceTable { &mut self.table } } @@ -123,7 +117,7 @@ impl Image { wasi.stdout(output_stream); let wasi = wasi.build(); - let table = Table::new(); + let table = ResourceTable::new(); let store = Store::new(&self.engine, WasiContext { wasi, table }); Ok(Container { diff --git a/packages/vm/src/stream.rs b/packages/vm/src/stream.rs index 414b18f..50c551d 100644 --- a/packages/vm/src/stream.rs +++ b/packages/vm/src/stream.rs @@ -2,7 +2,7 @@ use bytes::Bytes; use flume::Sender; use std::sync::{Arc, Mutex}; -use wasmtime_wasi::preview2::{ +use wasmtime_wasi::{ HostInputStream, HostOutputStream, StdinStream, StdoutStream, StreamResult, Subscribe, };