From 6001df43b773c86de3867d85e7bf564d7b9647ae Mon Sep 17 00:00:00 2001 From: Daniel Vigovszky Date: Thu, 15 Feb 2024 11:38:13 +0100 Subject: [PATCH] Binding change required for golem-services integration --- Cargo.lock | 32 +++++++++++++++++++++++++++++--- wasm-rpc/src/lib.rs | 8 +++++++- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cdafe67f..a5fbbc58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,6 +140,25 @@ dependencies = [ "serde", ] +[[package]] +name = "bincode" +version = "2.0.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f11ea1a0346b94ef188834a65c068a03aec181c94896d481d7a0a40d85b0ce95" +dependencies = [ + "bincode_derive", + "serde", +] + +[[package]] +name = "bincode_derive" +version = "2.0.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e30759b3b99a1b802a7a3aa21c85c3ded5c28e1c83170d82d70f08bbf7f3e4c" +dependencies = [ + "virtue", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -616,6 +635,7 @@ version = "0.0.0" dependencies = [ "arbitrary", "bigdecimal", + "bincode 2.0.0-rc.3", "golem-wasm-ast", "proptest", "proptest-arbitrary-interop", @@ -1455,6 +1475,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "virtue" +version = "0.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dcc60c0624df774c82a0ef104151231d37da4962957d691c011c852b2473314" + [[package]] name = "wait-timeout" version = "0.2.0" @@ -1543,7 +1569,7 @@ checksum = "910fabce77e660f0e0e41cfd5f69fc8bf020a025f059718846e918db7177f469" dependencies = [ "anyhow", "async-trait", - "bincode", + "bincode 1.3.3", "bumpalo", "cfg-if", "encoding_rs", @@ -1591,7 +1617,7 @@ checksum = "45cbd74a636f09d2108f9405c79857f061e19323e4abeed22e837cfe7b08a22b" dependencies = [ "anyhow", "base64", - "bincode", + "bincode 1.3.3", "directories-next", "log", "rustix", @@ -1711,7 +1737,7 @@ checksum = "9b3e48395ac672b386ed588d97a9612aa13a345008f26466f0dfb2a91628aa9f" dependencies = [ "addr2line", "anyhow", - "bincode", + "bincode 1.3.3", "cfg-if", "cpp_demangle", "gimli", diff --git a/wasm-rpc/src/lib.rs b/wasm-rpc/src/lib.rs index 53bbb145..9a89c95c 100644 --- a/wasm-rpc/src/lib.rs +++ b/wasm-rpc/src/lib.rs @@ -54,11 +54,17 @@ bindgen!({ tracing: false, async: true, with: { + "golem:rpc/types/wasm-rpc": WasmRpcEntry } }); #[cfg(feature = "host")] -pub use golem::rpc::types::{HostWasmRpc, NodeIndex, WitNode, WitValue}; +pub use golem::rpc::types::{Host, HostWasmRpc, NodeIndex, WitNode, WitValue}; + +#[cfg(feature = "host")] +pub struct WasmRpcEntry { + pub payload: Box, +} /// A tree representation of Value - isomorphic to the protobuf Val type but easier to work with in Rust #[derive(Debug, Clone, PartialEq)]