If `value` is present in `values` (aka the dictionary), returns the corresponding key (index into the `values` array). Otherwise returns `None`. Panics if `values` is not a [`StringArray`].
(&self, value: &str)
| 363 | /// |
| 364 | /// Panics if `values` is not a [`StringArray`]. |
| 365 | pub fn lookup_key(&self, value: &str) -> Option<K::Native> { |
| 366 | let rd_buf: &StringArray = self.values.as_any().downcast_ref::<StringArray>().unwrap(); |
| 367 | |
| 368 | (0..rd_buf.len()) |
| 369 | .position(|i| rd_buf.value(i) == value) |
| 370 | .and_then(K::Native::from_usize) |
| 371 | } |
| 372 | |
| 373 | /// Returns a reference to the dictionary values array |
| 374 | pub fn values(&self) -> &ArrayRef { |