MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / downcast_array

Function downcast_array

src/repr/src/row/encode.rs:1527–1532  ·  view source on GitHub ↗
(array: &Arc<dyn Array>)

Source from the content-addressed store, hash-verified

1525/// very hot path and downcasting is relatively slow
1526#[inline]
1527fn downcast_array<T: 'static>(array: &Arc<dyn Array>) -> Result<&T, anyhow::Error> {
1528 array
1529 .as_any()
1530 .downcast_ref::<T>()
1531 .ok_or_else(|| anyhow!("expected {}, found {array:?}", std::any::type_name::<T>()))
1532}
1533
1534/// Small helper function to downcast from an array to a [`DatumColumnDecoder`].
1535///

Callers 1

array_to_decoderFunction · 0.70

Calls 1

as_anyMethod · 0.45

Tested by

no test coverage detected