Returns the element at index `i` Note: This method does not check for nulls and the value is arbitrary (but still well-defined) if [`is_null`](Self::is_null) returns true for the index. # Panics Panics if index `i` is out of bounds.
(&self, i: usize)
| 340 | /// # Panics |
| 341 | /// Panics if index `i` is out of bounds. |
| 342 | pub fn value(&self, i: usize) -> &T::Native { |
| 343 | assert!( |
| 344 | i < self.len(), |
| 345 | "Trying to access an element at index {} from a {}{}Array of length {}", |
| 346 | i, |
| 347 | T::Offset::PREFIX, |
| 348 | T::PREFIX, |
| 349 | self.len() |
| 350 | ); |
| 351 | // SAFETY: |
| 352 | // Verified length above |
| 353 | unsafe { self.value_unchecked(i) } |
| 354 | } |
| 355 | |
| 356 | /// constructs a new iterator |
| 357 | pub fn iter(&self) -> ArrayIter<&Self> { |