Trait LongRefFromWasmAbi
pub trait LongRefFromWasmAbi: WasmDescribe
A version of the RefFromWasmAbi trait with the additional requirement
that the reference must remain valid as long as the anchor isn't dropped.
This isn't the case for JsValue's RefFromWasmAbi implementation. To
avoid having to allocate a spot for the JsValue on the JsValue heap,
the JsValue is instead pushed onto the JsValue stack, and popped off
again after the function that the reference was passed to returns. So,
JsValue has a different LongRefFromWasmAbi implementation that behaves
the same as FromWasmAbi, putting the value on the heap.
This is needed for async functions, where the reference needs to be valid
for the whole length of the Future, rather than the initial synchronous
call.
'long ref' is short for 'long-lived reference'.
⚠️ Unstable
This is part of the internal convert module, no
stability guarantees are provided. Use at your own risk. See its
documentation for more details.
Associated Types
type Abi: WasmAbi;Same as
RefFromWasmAbi::Abitype Anchor: Borrow<Self>;Same as
RefFromWasmAbi::Anchor
Required Methods
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::AnchorSame as
RefFromWasmAbi::ref_from_abi
Implementors
impl LongRefFromWasmAbi for JsValueimpl LongRefFromWasmAbi for Nullimpl LongRefFromWasmAbi for Undefinedimpl LongRefFromWasmAbi for [MaybeUninit<f32>]impl LongRefFromWasmAbi for [MaybeUninit<f64>]impl LongRefFromWasmAbi for [MaybeUninit<i16>]impl LongRefFromWasmAbi for [MaybeUninit<i32>]impl LongRefFromWasmAbi for [MaybeUninit<i64>]impl LongRefFromWasmAbi for [MaybeUninit<i8>]impl LongRefFromWasmAbi for [MaybeUninit<isize>]impl LongRefFromWasmAbi for [MaybeUninit<u16>]impl LongRefFromWasmAbi for [MaybeUninit<u32>]impl LongRefFromWasmAbi for [MaybeUninit<u64>]impl LongRefFromWasmAbi for [MaybeUninit<u8>]impl LongRefFromWasmAbi for [MaybeUninit<usize>]impl LongRefFromWasmAbi for [f32]impl LongRefFromWasmAbi for [f64]impl LongRefFromWasmAbi for [i16]impl LongRefFromWasmAbi for [i32]impl LongRefFromWasmAbi for [i64]impl LongRefFromWasmAbi for [i8]impl LongRefFromWasmAbi for [isize]impl LongRefFromWasmAbi for [u16]impl LongRefFromWasmAbi for [u32]impl LongRefFromWasmAbi for [u64]impl LongRefFromWasmAbi for [u8]impl LongRefFromWasmAbi for [usize]impl LongRefFromWasmAbi for strimpl<T> LongRefFromWasmAbi for JsNullable<T>impl<T> LongRefFromWasmAbi for JsOption<T>