nstd_core_slice_new

Function nstd_core_slice_new 

Source
#[unsafe(no_mangle)]
pub extern "C" fn nstd_core_slice_new( ptr: NSTDAny, stride: NSTDUInt, align: NSTDUInt, len: NSTDUInt, ) -> NSTDOptionalSlice
Available on crate feature core only.
Expand description

Creates a new slice from raw data.

§Parameters:

  • NSTDAny ptr - A pointer to the first element in the sequence.

  • NSTDUInt stride - The number of bytes each element occupies.

  • NSTDUInt align - The alignment of each element in the slice.

  • NSTDUInt len - The number of elements in the sequence.

§Returns

NSTDOptionalSlice slice - The new slice on success, or an uninitialized “none” variant if ptr is null, align is not a power of two, stride is not a multiple of align, ptr is not a multiple of align, or the slice’s length in bytes would exceed NSTDInt’s max value.