Struct WasmRet

#[repr(C)]
pub struct WasmRet<T: WasmAbi> { /* private fields */ }

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

impl<T: WasmAbi> WasmRet<T>

fn join(self) -> T

Joins the components of this WasmRet back into the type they represent.

Trait Implementations

impl<T: WasmAbi> From<T> for WasmRet<T>

fn from(value: T) -> Self

Auto Trait Implementations

impl<T> Freeze for WasmRet<T> where <T as WasmAbi>::Prim1: Freeze, <T as WasmAbi>::Prim2: Freeze, <T as WasmAbi>::Prim3: Freeze, <T as WasmAbi>::Prim4: Freeze,

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> where <T as WasmAbi>::Prim1: Send, <T as WasmAbi>::Prim2: Send, <T as WasmAbi>::Prim3: Send, <T as WasmAbi>::Prim4: Send,

impl<T> Sync for WasmRet<T> where <T as WasmAbi>::Prim1: Sync, <T as WasmAbi>::Prim2: Sync, <T as WasmAbi>::Prim3: Sync, <T as WasmAbi>::Prim4: Sync,

impl<T> Unpin for WasmRet<T> where <T as WasmAbi>::Prim1: Unpin, <T as WasmAbi>::Prim2: Unpin, <T as WasmAbi>::Prim3: Unpin, <T as WasmAbi>::Prim4: Unpin,

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

impl<S, T> Upcast<T> for WasmRet<T> where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for WasmRet<T> where T: 'static + ?Sized,

impl<T> Borrow<T> for WasmRet<T> where T: ?Sized,

impl<T> BorrowMut<T> for WasmRet<T> where T: ?Sized,

impl<T> From<T> for WasmRet<T>

impl<T, U> Into<U> for WasmRet<T> where U: From<T>,

impl<T, U> TryFrom<U> for WasmRet<T> where U: Into<T>,

impl<T, U> TryInto<U> for WasmRet<T> where U: TryFrom<T>,