Hello.
I'm using the wasmtime crate in a project of mine, and am writing some helper traits for converting from tuples of Rust types to WASM-compatible types. I wrote this trait, which worked until I needed to add Send
as a requirement to the returned Future
.
pub unsafe trait VxToWasmList : Tuple + Sized {
type Vx<'l> : Tuple + Send;
type Wasm : WasmTyList + WasmParams + WasmRet + Copy + Send + 'static;
fn to_wasm(
vx_val : Self::Vx<'_>,
instance : WasmInstance,
store : &mut (impl WasmAsContextMut<Data = VxRunnerState> + Send + Sync
)) -> impl Future<Output = Result<Self::Wasm, VxRunError>> + Send;
// ^^^^ This.
}
Calling to_wasm
now causes this error:
error: lifetime bound not satisfied
this is a known limitation that will be removed in the future (see issue #100013 <https://github.com/rust-lang/rust/issues/100013> for more information)
Until this limitation is fixed, how can I work around it?
Thanks.