Skip to main content

ListSwapFn

Type Alias ListSwapFn 

Source
pub type ListSwapFn = unsafe fn(PtrMut, usize, usize, &'static Shape) -> bool;
Expand description

Swap the elements at indices a and b in the list.

Returns false if either index is out of bounds (in which case no swap occurs); true on success. Swapping an index with itself is a no-op and still returns true.

The shape parameter is the list’s shape, allowing type-erased implementations to extract the element size from shape.type_params[0].

§Safety

The list parameter must point to aligned, initialized memory of the correct type.