Expand description
Flexible numeric-input helpers — accept any of NumericArray, PackedArray,
or ByteArray on the wire and widen the element type into the caller’s
target T. The widening rules are lossless: a source type is accepted
only when every value of its domain is exactly representable in the target.
Used by the hand-written Vec<T> impls in [crate::from_wolfram] and by
the field-extract code emitted by the FromWolfram derive macro
(VecOfNumeric and NumericTensor field kinds).
ByteArray on the wire is treated as a 1-D NumericArray<Integer8> before
the widening rules apply.
Traits§
- Numeric
Target - Sealed trait implemented for each numeric primitive that the WXF derive /
hand-impl path can read into. Each impl knows its target
DTand how to widen from any compatible sourceDT.
Functions§
- read_
fixed - Like
read_vecbut errors if the resulting buffer length doesn’t equaln. - read_
fixed_ with_ tag read_fixedgiven an already-consumed expression token.- read_
vec - Read the next value as a flat
Vec<T>. AcceptsNumericArray,PackedArray(any rank — multi-dim flattens row-major), orByteArray(treated as a 1-DNumericArray<Integer8>). - read_
vec_ with_ tag read_vecgiven an already-consumed expression token.