Skip to main content

TypeId

Enum TypeId 

Source
#[non_exhaustive]
#[repr(i32)]
pub enum TypeId {
Show 29 variants Empty = 0, Int8 = 1, Int16 = 2, Int32 = 3, Int64 = 4, Uint8 = 5, Uint16 = 6, Uint32 = 7, Uint64 = 8, Float32 = 9, Float64 = 10, Bool8 = 11, TimestampDays = 12, TimestampSeconds = 13, TimestampMilliseconds = 14, TimestampMicroseconds = 15, TimestampNanoseconds = 16, DurationDays = 17, DurationSeconds = 18, DurationMilliseconds = 19, DurationMicroseconds = 20, DurationNanoseconds = 21, Dictionary32 = 22, String = 23, List = 24, Decimal32 = 25, Decimal64 = 26, Decimal128 = 27, Struct = 28,
}
Expand description

Identifies the element type stored in a Column.

This enum mirrors cudf::type_id and covers all data types supported by libcudf, including numeric, temporal, string, and nested types.

IMPORTANT: Synchronization requirement – The discriminant values in this enum MUST match cudf::type_id (C++) exactly. The cxx bridge passes type IDs as i32, so this enum’s #[repr(i32)] values are the source of truth on the Rust side. If you add or reorder variants, update both the C++ cudf::type_id mapping and this enum.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Empty = 0

Empty (no data)

§

Int8 = 1

Signed 8-bit integer

§

Int16 = 2

Signed 16-bit integer

§

Int32 = 3

Signed 32-bit integer

§

Int64 = 4

Signed 64-bit integer

§

Uint8 = 5

Unsigned 8-bit integer

§

Uint16 = 6

Unsigned 16-bit integer

§

Uint32 = 7

Unsigned 32-bit integer

§

Uint64 = 8

Unsigned 64-bit integer

§

Float32 = 9

32-bit floating point

§

Float64 = 10

64-bit floating point

§

Bool8 = 11

Boolean (stored as 8-bit)

§

TimestampDays = 12

Timestamp in days since epoch

§

TimestampSeconds = 13

Timestamp in seconds since epoch

§

TimestampMilliseconds = 14

Timestamp in milliseconds since epoch

§

TimestampMicroseconds = 15

Timestamp in microseconds since epoch

§

TimestampNanoseconds = 16

Timestamp in nanoseconds since epoch

§

DurationDays = 17

Duration in days

§

DurationSeconds = 18

Duration in seconds

§

DurationMilliseconds = 19

Duration in milliseconds

§

DurationMicroseconds = 20

Duration in microseconds

§

DurationNanoseconds = 21

Duration in nanoseconds

§

Dictionary32 = 22

Dictionary-encoded column (32-bit indices)

§

String = 23

Variable-length UTF-8 string

§

List = 24

List (nested column of variable-length sequences)

§

Decimal32 = 25

32-bit fixed-point decimal

§

Decimal64 = 26

64-bit fixed-point decimal

§

Decimal128 = 27

128-bit fixed-point decimal

§

Struct = 28

Struct (nested column of named fields)

Implementations§

Source§

impl TypeId

Source

pub fn size_in_bytes(self) -> usize

Returns the size in bytes of a single element of this type. Returns 0 for variable-width types (String, List, Struct).

Source

pub fn is_fixed_width(self) -> bool

Whether this type has a fixed width (known size per element).

Source

pub fn is_numeric(self) -> bool

Whether this type is a numeric type (integer or floating point).

Source

pub fn is_integer(self) -> bool

Whether this type is an integer type.

Source

pub fn is_floating(self) -> bool

Whether this type is a floating-point type.

Source

pub fn is_temporal(self) -> bool

Whether this type is a temporal type (timestamp or duration).

Source

pub fn is_nested(self) -> bool

Whether this type is a nested type (List, Struct).

Source

pub fn from_raw(value: i32) -> Option<Self>

Convert from raw i32 value. Returns None if the value is not a valid TypeId.

Trait Implementations§

Source§

impl Clone for TypeId

Source§

fn clone(&self) -> TypeId

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TypeId

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TypeId

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<TypeId> for DataType

Source§

fn from(id: TypeId) -> Self

Converts to this type from the input type.
Source§

impl Hash for TypeId

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for TypeId

Source§

fn eq(&self, other: &TypeId) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for TypeId

Source§

impl Eq for TypeId

Source§

impl StructuralPartialEq for TypeId

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,