#[non_exhaustive]pub enum TypeChar {
Bool,
Int,
Uint,
Float,
Complex,
TimeDelta,
DateTime,
ByteStr,
UnicodeStr,
RawData,
}
Expand description
Represents the second character in a TypeStr
.
Indicates the type of data stored. Affects the interpretation of TypeStr::size_field
and
TypeStr::endianness
.
Complete documentation of which rust types can serialize as which dtypes can be found
at type_matchup_docs
.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bool
Code b
.
size
must be 1, and legal values are 0x00
(false
) or 0x01
(true
).
Int
Code i
.
Notice that numpy does not support 128-bit integers.
Uint
Code u
.
Notice that numpy does not support 128-bit integers.
Float
Code f
.
Notice that numpy does support 128-bit floats.
Complex
Code c
. Represents a complex number.
The real part followed by the imaginary part, with size
bytes total between the two of
them. Each part has the specified endianness, but the real part always comes first.
You can deserialize this using the "complex"
feature.
TimeDelta
Code m
. Represents a numpy.timedelta64
.
Can use i64
for serialization. size
must be 8.
Check TypeStr::time_units
for the units.
DateTime
Code M
. Represents a numpy.datetime64
.
Can use i64
for serialization. size
must be 8.
Check TypeStr::time_units
for the units.
ByteStr
Code S
or a
. Represents a zero-terminated Python 3 bytes
(str
in Python 2).
Can use Vec<u8>
for serialization, or some other types; see
type_matchup_docs
for more info.
UnicodeStr
Code U
. Represents a Python 3 str
(unicode
in Python 2).
A str
that contains size
code points (not bytes!). Each code unit is encoded as a
32-bit integer of the given endianness. Strings with fewer than size
code units are
zero-padded on the right. (thus they cannot contain trailing copies of U+0000 ‘NULL’;
they can, however, contain interior copies)
Note the deliberate use of the term “code point” and not “scalar value”; values outside of
the range [0, 0x110000)
are forbidden, but surrogate code points are allowed.
See type_matchup_docs
for information on which types can
use this for serialization.
RawData
Code V
. Represents a binary blob of size
bytes.
Can use crate::FixedSizeBytes
for serialization, or some other types; see
type_matchup_docs
for more info.