Appearance
cellpack::format::cpk::Dtype
Module contract · All interfaces
At a glance
pub enum Dtype {
U8,
U16,
U32,
U64,
I8,
I16,
I32,
I64,
F32,
F64,
}Numeric type of a matrix’s values; its width is the chunks’ value width.
The discriminant is the code stored in the superblock’s dtype byte, so the declaration order is part of the file format and cannot be rearranged without changing the version.
Fields and variants
U8
U8Unsigned, 1 byte (code 0).
U16
U16Unsigned, 2 bytes (code 1).
U32
U32Unsigned, 4 bytes (code 2).
U64
U64Unsigned, 8 bytes (code 3).
I8
I8Signed, 1 byte (code 4).
I16
I16Signed, 2 bytes (code 5).
I32
I32Signed, 4 bytes (code 6).
I64
I64Signed, 8 bytes (code 7).
F32
F32IEEE binary32, 4 bytes (code 8).
F64
F64IEEE binary64, 8 bytes (code 9).
Member index
Methods and associated constants
width
Bytes of one stored value: 1, 2, 4 or 8.
f32
One little-endian value as f32.
Reads the first Dtype::width bytes of b and converts, so integers lose precision above 2^24 and F64 rounds; b must hold that many bytes.
Implemented traits
Contract reference
See the module reference for semantic input/output rules, units, allocation, mutation, failure behavior, and lifetime requirements. Declarations and documented members are synchronized from the crate source.