pub trait SliceArg {
// Required method
fn apply(
self,
dim_size: usize,
dim_stride: isize,
out_shape: &mut [usize],
out_strides: &mut [isize],
new_ndim: &mut usize,
offset: &mut isize,
) -> Result<(), TensorError>;
}Expand description
Processes one axis of a slice operation, directly computing the effect on output shape, strides, and byte offset — no intermediate enum dispatch.
Each impl is monomorphized and fully inlined, so the compiler sees concrete types at every call site with zero runtime branching overhead.
Unsigned types: RangeFull, usize, Range<usize>, RangeTo<usize>,
RangeFrom<usize>, RangeInclusive<usize>.
Signed types (negative wraps from end): isize, Range<isize>,
RangeTo<isize>, RangeFrom<isize>, RangeInclusive<isize>.
Stepped: RangeStep (Rust has no built-in stepped range literal).
Note: integer literals default to i32, so write 0_usize not 0.