Enum npyz::DType [−][src]
Expand description
Representation of a Numpy type
Variants
Plain(TypeStr)
Numpy type string. First character is '>'
for big endian, '<'
for little endian,
or can be '|'
if it doesn’t matter.
Examples: >i4
, <u8
, >f8
, |S7
. The number usually corresponds to the number of
bytes (with the single exception of unicode strings |U3
).
Fixed-size inner array type.
This is only possible inside structured arrays, where fields can themselves be arrays.
E.g. in the DType
for dtype=[('abc', 'i4', [2, 3])]
, the DType
for abc
will be Array(2, Array(3, Plain("<i4")))
. In rust, such an array could be read using
the following element type:
#[derive(npyz::Serialize, npyz::Deserialize, npyz::AutoSerialize)] struct Row { abc: [[i32; 3]; 2], }
A structure record array
Implementations
Numpy format description of record dtype.
Calling descr
on DType::Array
will not produce a valid python expression
(the string will only be suitable for error messages).
Construct a scalar DType
. (one which is not a nested array or record type)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DType
impl UnwindSafe for DType
Blanket Implementations
Mutably borrows from an owned value. Read more