#[non_exhaustive]pub enum DataType {
Show 49 variants
Bool,
Int2,
Int4,
Int8,
Int16,
Int32,
Int64,
UInt2,
UInt4,
UInt8,
UInt16,
UInt32,
UInt64,
Float4E2M1FN,
Float6E2M3FN,
Float6E3M2FN,
Float8E3M4,
Float8E4M3,
Float8E4M3B11FNUZ,
Float8E4M3FNUZ,
Float8E5M2,
Float8E5M2FNUZ,
Float8E8M0FNU,
BFloat16,
Float16,
Float32,
Float64,
ComplexBFloat16,
ComplexFloat16,
ComplexFloat32,
ComplexFloat64,
ComplexFloat4E2M1FN,
ComplexFloat6E2M3FN,
ComplexFloat6E3M2FN,
ComplexFloat8E3M4,
ComplexFloat8E4M3,
ComplexFloat8E4M3B11FNUZ,
ComplexFloat8E4M3FNUZ,
ComplexFloat8E5M2,
ComplexFloat8E5M2FNUZ,
ComplexFloat8E8M0FNU,
Complex64,
Complex128,
RawBits(usize),
String,
Bytes,
NumpyDateTime64 {
unit: NumpyTimeUnit,
scale_factor: NonZeroU32,
},
NumpyTimeDelta64 {
unit: NumpyTimeUnit,
scale_factor: NonZeroU32,
},
Extension(Arc<dyn DataTypeExtension>),
}Expand description
A data type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bool
bool Boolean.
Int2
int2 Integer in [-2, 1].
Int4
int4 Integer in [-8, 7].
Int8
int8 Integer in [-2^7, 2^7-1].
Int16
int16 Integer in [-2^15, 2^15-1].
Int32
int32 Integer in [-2^31, 2^31-1].
Int64
int64 Integer in [-2^63, 2^63-1].
UInt2
uint2 Integer in [0, 3].
UInt4
uint4 Integer in [0, 15].
UInt8
uint8 Integer in [0, 2^8-1].
UInt16
uint16 Integer in [0, 2^16-1].
UInt32
uint32 Integer in [0, 2^32-1].
UInt64
uint64 Integer in [0, 2^64-1].
Float4E2M1FN
float4_e2m1fn a 4-bit floating point representation: sign bit, 2 bit exponent (bias 1), 1 bit mantissa.
- Extended range: no infinity, no NaN.
- Subnormal numbers when biased exponent is 0.
Float6E2M3FN
float6_e2m3fn a 6-bit floating point representation: sign bit, 2 bit exponent (bias 1), 3 bit mantissa.
- Extended range: no infinity, no NaN.
- Subnormal numbers when biased exponent is 0.
Float6E3M2FN
float6_e3m2fn a 6-bit floating point representation: sign bit, 3 bit exponent (bias 3), 2 bit mantissa.
- Extended range: no infinity, no NaN.
- Subnormal numbers when biased exponent is 0.
Float8E3M4
float8_e3m4 an 8-bit floating point representation: sign bit, 3 bit exponent (bias 3), 4 bit mantissa.
- IEEE 754-compliant, with NaN and +/-inf.
Float8E4M3
float8_e4m3 an 8-bit floating point representation: sign bit, 4 bit exponent (bias 7), 3 bit mantissa.
- IEEE 754-compliant, with NaN and +/-inf.
Float8E4M3B11FNUZ
float8_e4m3b11fnuz an 8-bit floating point representation: sign bit, 4 bit exponent (bias 11), 3 bit mantissa.
- Extended range: no infinity, NaN represented by
0b1000'0000. - Subnormal numbers when biased exponent is 0.
Float8E4M3FNUZ
float8_e4m3fnuz an 8-bit floating point representation: sign bit, 4 bit exponent (bias 8), 3 bit mantissa.
- Extended range: no infinity, NaN represented by
0b1000'0000. - Subnormal numbers when biased exponent is 0.
Float8E5M2
float8_e5m2 an 8-bit floating point representation: sign bit, 5 bit exponent (bias 15), 2 bit mantissa.
- IEEE 754-compliant, with NaN and +/-inf.
- Subnormal numbers when biased exponent is 0.
Float8E5M2FNUZ
float8_e5m2fnuz an 8-bit floating point representation: sign bit, 5 bit exponent (bias 16), 2 bit mantissa.
- Extended range: no infinity, NaN represented by
0b1000'0000. - Subnormal numbers when biased exponent is 0.
Float8E8M0FNU
float8_e8m0fnu an 8-bit floating point representation: no sign bit, 8 bit exponent (bias 127), 0 bit mantissa.
- No zero, no infinity, NaN represented by
0b1111'1111. - No subnormal numbers.
BFloat16
bfloat16 brain floating point data type: sign bit, 5 bits exponent, 10 bits mantissa.
Float16
float16 IEEE 754 half-precision floating point: sign bit, 5 bits exponent, 10 bits mantissa.
Float32
float32 IEEE 754 single-precision floating point: sign bit, 8 bits exponent, 23 bits mantissa.
Float64
float64 IEEE 754 double-precision floating point: sign bit, 11 bits exponent, 52 bits mantissa.
ComplexBFloat16
complex_float32 real and complex components are each brain floating point data type.
ComplexFloat16
complex_float32 real and complex components are each IEEE 754 half-precision floating point.
ComplexFloat32
complex_float32 real and complex components are each IEEE 754 single-precision floating point.
ComplexFloat64
complex_float64 real and complex components are each IEEE 754 double-precision floating point.
ComplexFloat4E2M1FN
complex_float4_e2m1fn real and complex components are each the float4_e2m1fn type.
ComplexFloat6E2M3FN
complex_float6_e2m3fn real and complex components are each the float6_e2m3fn type.
ComplexFloat6E3M2FN
complex_float6_e3m2fn real and complex components are each the float6_e3m2fn type.
ComplexFloat8E3M4
complex_float8_e3m4 real and complex components are each the float8_e3m4 type.
ComplexFloat8E4M3
complex_float8_e4m3 real and complex components are each the float8_e4m3 type.
ComplexFloat8E4M3B11FNUZ
complex_float8_e4m3b11fnuz real and complex components are each the float8_e4m3b11fnuz type.
ComplexFloat8E4M3FNUZ
complex_float8_e4m3fnuz real and complex components are each the float8_e4m3fnuz type.
ComplexFloat8E5M2
complex_float8_e5m2 real and complex components are each the float8_e5m2 type.
ComplexFloat8E5M2FNUZ
complex_float8_e5m2fnuz real and complex components are each the float8_e5m2fnuz type.
ComplexFloat8E8M0FNU
complex_float8_e8m0fnu real and complex components are each the float8_e8m0fnu type.
Complex64
complex64 real and complex components are each IEEE 754 single-precision floating point.
Complex128
complex128 real and complex components are each IEEE 754 double-precision floating point.
RawBits(usize)
r* raw bits, variable size given by *, limited to be a multiple of 8.
String
A UTF-8 encoded string.
Bytes
Variable-sized binary data.
NumpyDateTime64
numpy.datetime64 a 64-bit signed integer represents moments in time relative to the Unix epoch.
This data type closely models the datetime64 data type from NumPy.
Fields
unit: NumpyTimeUnitThe NumPy temporal unit.
scale_factor: NonZeroU32The NumPy temporal scale factor.
NumpyTimeDelta64
numpy.timedelta64 a 64-bit signed integer represents signed temporal durations.
This data type closely models the timedelta64 data type from NumPy.
Fields
unit: NumpyTimeUnitThe NumPy temporal unit.
scale_factor: NonZeroU32The NumPy temporal scale factor.
Extension(Arc<dyn DataTypeExtension>)
An extension data type.
Implementations§
Source§impl DataType
impl DataType
Sourcepub fn metadata(&self) -> MetadataV3
pub fn metadata(&self) -> MetadataV3
Returns the metadata.
Sourcepub fn size(&self) -> DataTypeSize
pub fn size(&self) -> DataTypeSize
Returns the DataTypeSize.
Sourcepub fn fixed_size(&self) -> Option<usize>
pub fn fixed_size(&self) -> Option<usize>
Returns the size in bytes of a fixed-size data type, otherwise returns None.
Sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
Returns true if the data type has a variable size.
Sourcepub fn from_metadata(
metadata: &MetadataV3,
data_type_aliases: &ExtensionAliasesDataTypeV3,
) -> Result<Self, PluginCreateError>
pub fn from_metadata( metadata: &MetadataV3, data_type_aliases: &ExtensionAliasesDataTypeV3, ) -> Result<Self, PluginCreateError>
Create a data type from metadata.
§Errors
Returns PluginCreateError if the metadata is invalid or not associated with a registered data type plugin.
Sourcepub fn fill_value_from_metadata(
&self,
fill_value: &FillValueMetadataV3,
) -> Result<FillValue, DataTypeFillValueMetadataError>
pub fn fill_value_from_metadata( &self, fill_value: &FillValueMetadataV3, ) -> Result<FillValue, DataTypeFillValueMetadataError>
Create a fill value from metadata.
§Errors
Returns DataTypeFillValueMetadataError if the fill value is incompatible with the data type.
Sourcepub fn metadata_fill_value(
&self,
fill_value: &FillValue,
) -> Result<FillValueMetadataV3, DataTypeFillValueError>
pub fn metadata_fill_value( &self, fill_value: &FillValue, ) -> Result<FillValueMetadataV3, DataTypeFillValueError>
Create fill value metadata.
§Errors
Returns an DataTypeFillValueError if the metadata cannot be created from the fill value.
Trait Implementations§
Source§impl From<DataType> for ArrayBuilderDataType
impl From<DataType> for ArrayBuilderDataType
Source§impl From<DataType> for NamedDataType
impl From<DataType> for NamedDataType
impl Eq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl Send for DataType
impl Sync for DataType
impl !RefUnwindSafe for DataType
impl Unpin for DataType
impl !UnwindSafe for DataType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more