pub trait ArrayElement:
Clone
+ Send
+ Sync
+ 'static {
const DTYPE: DType;
// Required methods
fn encode_chunk(values: &[Self]) -> Vec<u8> ⓘ;
fn decode_chunk(bytes: &[u8]) -> Vec<Self>;
fn fill_element(fill: Option<&FillValue>) -> Self;
}Expand description
Unified element type for all array operations.
Implemented by all fixed-width numeric primitives and variable-length
types (String, Vec<u8>). The trait provides chunk-level encode/decode
and fill-value generation so that a single generic code path handles both.
Required Associated Constants§
Required Methods§
Sourcefn encode_chunk(values: &[Self]) -> Vec<u8> ⓘ
fn encode_chunk(values: &[Self]) -> Vec<u8> ⓘ
Encodes a chunk’s worth of values into the on-disk byte representation.
Sourcefn decode_chunk(bytes: &[u8]) -> Vec<Self>
fn decode_chunk(bytes: &[u8]) -> Vec<Self>
Decodes bytes produced by encode_chunk back into
values.
Sourcefn fill_element(fill: Option<&FillValue>) -> Self
fn fill_element(fill: Option<&FillValue>) -> Self
Returns the element used for unwritten positions, derived from the
array’s fill value (or this type’s natural default when fill is
None or not applicable).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".