Files
wasmtime/crates/wasi-crypto/src/lib.rs
Alex Crichton 7a1b7cdf92 Implement RFC 11: Redesigning Wasmtime's APIs (#2897)
Implement Wasmtime's new API as designed by RFC 11. This is quite a large commit which has had lots of discussion externally, so for more information it's best to read the RFC thread and the PR thread.
2021-06-03 09:10:53 -05:00

16 lines
591 B
Rust

mod wiggle_interfaces;
pub use wiggle_interfaces::WasiCryptoCtx;
pub fn add_to_linker<T>(
linker: &mut wasmtime::Linker<T>,
get_cx: impl Fn(&mut T) -> &mut WasiCryptoCtx + Send + Sync + Copy + 'static,
) -> anyhow::Result<()> {
use wiggle_interfaces::wasi_modules as w;
w::wasi_ephemeral_crypto_common::add_to_linker(linker, get_cx)?;
w::wasi_ephemeral_crypto_asymmetric_common::add_to_linker(linker, get_cx)?;
w::wasi_ephemeral_crypto_signatures::add_to_linker(linker, get_cx)?;
w::wasi_ephemeral_crypto_symmetric::add_to_linker(linker, get_cx)?;
Ok(())
}