pub unsafe fn dynamic_slice_into_uninit<T, I>(
plan: &DynamicSlicePlan,
dest: &mut RawStridedMut<'_, MaybeUninit<T>>,
operand: &RawStridedRef<'_, T>,
starts: &RawStridedRef<'_, I>,
exec: Exec<'_>,
) -> Result<()>Expand description
Full-overwrite indexed replay for an operation-family adapter.
§Safety
The adapter must reject input/output overlap before creating the input references. All descriptor allocation and initialization contracts must remain valid for the call. Output slots may be uninitialized; the owning plan retains its checked layout/index validation and private initialization receipt. No initialized reference to the output backing may be formed.
§Examples
use strided_basic::execution::*;
// SAFETY: the example supplies matching bounded layouts and disjoint storage.
use strided_basic::{DynamicSlicePlan, RawStridedRef, RawStridedMut};
use core::mem::MaybeUninit;
let plan = DynamicSlicePlan::compile(&[3], &[1], &[1], &[1], &[2], &[1], &[2]).unwrap();
let src = RawStridedRef::new(&[1_i32, 2, 3], &[3], &[1], 0).unwrap();
let starts = RawStridedRef::new(&[1_i32], &[1], &[1], 0).unwrap();
let mut values = [MaybeUninit::<i32>::uninit(); 2];
let mut dst = RawStridedMut::new(&mut values, &[2], &[1], 0).unwrap();
unsafe { dynamic_slice_into_uninit(&plan, &mut dst, &src, &starts, strided_basic::Exec::serial()) }.unwrap();
assert_eq!(unsafe { values[1].assume_init() }, 3);§Errors
Returns StridedError::PlanLayoutMismatch when the destination, operand,
or start view does not carry the plan’s compiled extents and strides,
before any destination write. That is the only rejection: an empty
operand returns before any offset arithmetic, and a non-empty one carries
the bounds its constructor validated, so the replay arithmetic cannot
overflow. Out-of-range start values are clamped, not rejected.