Used to create a new [`ArrayFormatter`] from the given `array`, while also checking whether there is an override available in the [`ArrayFormatterFactory`].
(
array: &'a dyn Array,
options: &FormatOptions<'a>,
field: Option<&'a Field>,
)
| 393 | /// Used to create a new [`ArrayFormatter`] from the given `array`, while also checking whether |
| 394 | /// there is an override available in the [`ArrayFormatterFactory`]. |
| 395 | pub(crate) fn make_array_formatter<'a>( |
| 396 | array: &'a dyn Array, |
| 397 | options: &FormatOptions<'a>, |
| 398 | field: Option<&'a Field>, |
| 399 | ) -> Result<ArrayFormatter<'a>, ArrowError> { |
| 400 | match options.formatter_factory() { |
| 401 | None => ArrayFormatter::try_new(array, options), |
| 402 | Some(formatters) => formatters |
| 403 | .create_array_formatter(array, options, field) |
| 404 | .transpose() |
| 405 | .unwrap_or_else(|| ArrayFormatter::try_new(array, options)), |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | /// Implements [`Display`] for a specific array value |
| 410 | pub struct ValueFormatter<'a> { |
no test coverage detected