Returns the element at index `i` as a byte slice. 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)
| 220 | /// # Panics |
| 221 | /// Panics if index `i` is out of bounds. |
| 222 | pub fn value(&self, i: usize) -> &[u8] { |
| 223 | let len = self.len(); |
| 224 | assert!( |
| 225 | i < len, |
| 226 | "Trying to access an element at index {i} from a FixedSizeBinaryArray of length {len}", |
| 227 | ); |
| 228 | let position = i * self.value_size; |
| 229 | unsafe { |
| 230 | std::slice::from_raw_parts(self.value_data.as_ptr().add(position), self.value_size) |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | /// Returns the element at index `i` as a byte slice. |
| 235 | /// |