Skip to main content

Module type_unions

Module type_unions 

Source
Expand description

Numeric Traits Module - Contains num-trait wrappers that simplify Type Signature Ergonomics

Numeric trait bounds used throughout Minarrow.

This module defines small, crate-specific trait aliases over num_traits to keep generic signatures concise and consistent across arrays/kernels:

  • Float: f32, f64 (wrapper over num_traits::Float).
  • Integer: integer types that also support lossless casts to/from usize (implemented via impl_usize_conversions!), useful for offsets/indices.
  • Numeric: all supported number types (ints + floats) for math kernels.
  • Primitive: scalars (ints, floats, bool) used in low-level paths.

Use these in APIs like fn foo<T: Numeric>() or fn bar<I: Integer>() to express intent and rely on a single source of truth for allowed scalar types.

Traitsยง

Float
Trait for types valid as float elements in columnar arrays.
Integer
Trait for types valid as integer elements in columnar arrays.
Numeric
Trait for types valid as numerical.
Primitive
Trait for types valid as primitive, i.e.., floats, integers, and booleans.