Skip to main content

RefIntoWasmAbi

Trait RefIntoWasmAbi 

Source
pub trait RefIntoWasmAbi: Sealed {
    type Abi: WasmAbi;

    // Required methods
    fn describe_ref();
    fn ref_into_abi(&self) -> Self::Abi;
}
Expand description

A type whose shared references can cross the Wasm ABI, i.e. for<'a> &'a Self: IntoWasmAbi.

Rust does not imply a trait’s where clauses on Self the way it implies supertraits, so an alias trait for that higher-ranked bound would not let generic code use &T: IntoWasmAbi. This trait carries the conversion itself instead, and experimental_generic_mono imports marshal a &T argument through it, so T: RefIntoWasmAbi is the bound they declare. It is sealed, holding exactly where the higher-ranked bound does.

§⚠️ 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.

Required Associated Types§

Source

type Abi: WasmAbi

The Wasm ABI type that &Self converts into.

Required Methods§

Source

fn describe_ref()

Describe &Self.

Source

fn ref_into_abi(&self) -> Self::Abi

Convert &self into Self::Abi.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: ?Sized, A: WasmAbi> RefIntoWasmAbi for T
where for<'a> &'a T: IntoWasmAbi<Abi = A>,

Source§

type Abi = A