MCPcopy Create free account
hub / github.com/apache/arrow-rs / make_array_formatter

Function make_array_formatter

arrow-cast/src/display.rs:395–407  ·  view source on GitHub ↗

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>,
)

Source from the content-addressed store, hash-verified

393/// Used to create a new [`ArrayFormatter`] from the given `array`, while also checking whether
394/// there is an override available in the [`ArrayFormatterFactory`].
395pub(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
410pub struct ValueFormatter<'a> {

Callers 2

prepareMethod · 0.85
create_tableFunction · 0.85

Calls 3

try_newFunction · 0.85
formatter_factoryMethod · 0.80

Tested by

no test coverage detected