pub struct WasmRet<T: WasmAbi> { /* private fields */ }Expand description
A repr(C) struct containing all of the primitives of a WasmAbi type, in
order.
This is used as the return type of imported/exported functions. WasmAbi
types aren’t guaranteed to be FFI-safe, so we can’t return them directly:
instead we return this.
If all but one of the primitives is (), this corresponds to returning the
remaining primitive directly, otherwise a return pointer is used.
§⚠️ 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.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for WasmRet<T>
impl<T> RefUnwindSafe for WasmRet<T>where
<T as WasmAbi>::Prim1: RefUnwindSafe,
<T as WasmAbi>::Prim2: RefUnwindSafe,
<T as WasmAbi>::Prim3: RefUnwindSafe,
<T as WasmAbi>::Prim4: RefUnwindSafe,
impl<T> Send for WasmRet<T>
impl<T> Sync for WasmRet<T>
impl<T> Unpin for WasmRet<T>
impl<T> UnsafeUnpin for WasmRet<T>where
<T as WasmAbi>::Prim1: UnsafeUnpin,
<T as WasmAbi>::Prim2: UnsafeUnpin,
<T as WasmAbi>::Prim3: UnsafeUnpin,
<T as WasmAbi>::Prim4: UnsafeUnpin,
impl<T> UnwindSafe for WasmRet<T>where
<T as WasmAbi>::Prim1: UnwindSafe,
<T as WasmAbi>::Prim2: UnwindSafe,
<T as WasmAbi>::Prim3: UnwindSafe,
<T as WasmAbi>::Prim4: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S, T> Upcast<T> for S
impl<S, T> Upcast<T> for S
Source§fn upcast(&self) -> &T
fn upcast(&self) -> &T
Perform a zero-cost type-safe upcast to a wider ref type within the Wasm
bindgen generics type system. Read more
Source§fn upcast_into(self) -> Twhere
Self: Sized + ErasableGeneric,
T: Sized + ErasableGeneric<Repr = <Self as ErasableGeneric>::Repr>,
fn upcast_into(self) -> Twhere
Self: Sized + ErasableGeneric,
T: Sized + ErasableGeneric<Repr = <Self as ErasableGeneric>::Repr>,
Perform a zero-cost type-safe upcast to a wider type within the Wasm
bindgen generics type system. Read more