fix wasi-nn and wasi-crypto integrations for wasmtime-wiggle changes
the Rc<RefCell<ctx>> wrapping inside the wasmtime-generated bindings was eliminated, and instead the caller of ::new(linker, ctx) is required to wrap the ctx in Rc<RefCell<>>. The Rc wrapping inside WasiCryptoCtx can be eliminated due to this change.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::rc::Rc;
|
||||
|
||||
use wasi_crypto::CryptoCtx;
|
||||
pub use wasi_crypto::CryptoCtx as WasiCryptoCtx;
|
||||
|
||||
wiggle::from_witx!({
|
||||
witx: ["$CARGO_MANIFEST_DIR/spec/witx/wasi_ephemeral_crypto.witx"],
|
||||
@@ -17,19 +17,6 @@ pub mod wasi_modules {
|
||||
|
||||
pub use types as guest_types;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct WasiCryptoCtx {
|
||||
ctx: Rc<CryptoCtx>,
|
||||
}
|
||||
|
||||
impl WasiCryptoCtx {
|
||||
pub fn new() -> Self {
|
||||
WasiCryptoCtx {
|
||||
ctx: Rc::new(CryptoCtx::new()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod asymmetric_common;
|
||||
mod common;
|
||||
mod error;
|
||||
|
||||
Reference in New Issue
Block a user