Trait VectorRefIntoWasmAbi

pub trait VectorRefIntoWasmAbi

Internal trait used by the slice_to_array macro codegen.

Produces the wire representation JS observes when an outgoing &[T] argument is rendered as a plain Array. There are two impl shapes, neither of which requires T: Clone:

Both shapes carry the same WasmSlice (ptr + len) on the wire. The cli-support side picks the right JS shim based on the element VectorKind recovered from the descriptor.

Not user-facing: users opt in via #[wasm_bindgen(slice_to_array)] on an imported function or extern "C" block.

Required Methods

fn slice_into_abi(slice: &[Self]) -> WasmSlice
where
    Self: Sized,

Construct the wire representation for Some(slice). The returned WasmSlice is either a borrow of the input slice (primitive case) or a buffer JS owns and frees (handle-shaped case).

Provided Methods

fn slice_none() -> WasmSlice
where
    Self: Sized,

Wire representation for None (used by Option<&[T]>). A null WasmSlice (ptr == 0) is the convention shared with every other vector-like ABI in the crate.

Implementors