Struct spirv_std::RuntimeArray
source ·
[−]pub struct RuntimeArray<T> { /* private fields */ }Expand description
Dynamically-sized arrays in Rust carry around their length as the second half of a tuple. Unfortunately, sometimes SPIR-V provides an unsized array with no way of obtaining its length. Hence, this type represents something very similar to a slice, but with no way of knowing its length.
Implementations
Index the array. Unfortunately, because the length of the runtime array cannot be known, this function will happily index outside of the bounds of the array, and so is unsafe.
Safety
Bounds checking is not performed, and indexing outside the bounds of the array can happen, and lead to UB.
Index the array, returning a mutable reference to an element. Unfortunately, because the length of the runtime array cannot be known, this function will happily index outside of the bounds of the array, and so is unsafe.
Safety
Bounds checking is not performed, and indexing outside the bounds of the array can happen, and lead to UB.
