Expand description
§Conversions & Views - Most To/From Boilerplate Implements Here
Implementations that convert between Minarrow array types and wire them into the
unified Array enum, plus View impls where the views feature is enabled.
§What’s included
- Numeric <-> Numeric
- Widening
From<&IntegerArray<S>> for IntegerArray<D>andFrom<&IntegerArray<S>> for FloatArray<D>. - Narrowing / signedness changes via
TryFrom<&IntegerArray<S>> for IntegerArray<D>withMinarrowError::Overflowon out-of-range values.
- Widening
- Float <-> Integer
TryFrom<&FloatArray<F>> for IntegerArray<I>with strict checks (finite + exact truncation);
- Booleans <-> Primitives
From<&BooleanArray<u8>>to integer/float (true->1/1.0, false->0/0.0).From<&IntegerArray<T>>/From<&FloatArray<T>>toBooleanArray<u8>(non-zero -> true).
- Numerics/Booleans -> Strings
From<&IntegerArray<T>>,From<&FloatArray<T>>, andFrom<&BooleanArray<u8>>toStringArray<u32>(UTF-8), preserving null masks.
- Strings <-> Categoricals
TryFrom<&StringArray<Off>> for CategoricalArray<Idx>builds a dictionary with stable codes.TryFrom<&CategoricalArray<Idx>> for StringArray<Off>materialises codes back to UTF-8.- Widening/narrowing categorical index conversions (
From/TryFrom) with overflow checks.
- String offset width changes
From<&StringArray<u32>> for StringArray<u64>andTryFrom<&StringArray<u64>> for StringArray<u32>.
- Datetime conversions (feature
datetime)- Integer view of datetimes and width changes between
DatetimeArray<i32>andDatetimeArray<i64>.
- Integer view of datetimes and width changes between
- Into
ArrayenumFrom<Arc<...>> for ArrayandFrom<...> for Arrayfor all core variants, using cheapArcclones for zero-copy wrapping.
Viewtrait impls (featureviews)- Provides
BufferTfor owned andArcarray variants so you can call.view(...)/.view_tuple(...).
- Provides
§Null masks & semantics
Unless noted, conversions preserve the source null mask. Errors are explicit:
overflows use MinarrowError::Overflow; inexact float->int casts use MinarrowError::LossyCast.
§Feature gates
Some conversions are available only with extended_numeric_types, extended_categorical,
large_string, datetime, or views. Enable the features you need in Cargo.toml.