vortex_dtype

Enum DType

Source
pub enum DType {
    Null,
    Bool(Nullability),
    Primitive(PType, Nullability),
    Utf8(Nullability),
    Binary(Nullability),
    Struct(StructDType, Nullability),
    List(Arc<DType>, Nullability),
    Extension(Arc<ExtDType>),
}
Expand description

The logical types of elements in Vortex arrays.

Vortex arrays preserve a single logical type, while the encodings allow for multiple physical ways to encode that type.

Variants§

§

Null

The logical null type (only has a single value, null)

§

Bool(Nullability)

The logical boolean type (true or false if non-nullable; true, false, or null if nullable)

§

Primitive(PType, Nullability)

Primitive, fixed-width numeric types (e.g., u8, i8, u16, i16, u32, i32, u64, i64, f32, f64)

§

Utf8(Nullability)

UTF-8 strings

§

Binary(Nullability)

Binary data

§

Struct(StructDType, Nullability)

A struct is composed of an ordered list of fields, each with a corresponding name and DType TODO(ngates): we may want StructDType to be Arc<Field> instead so it’s only a single Arc.

§

List(Arc<DType>, Nullability)

A variable-length list type, parameterized by a single element DType

§

Extension(Arc<ExtDType>)

User-defined extension types

Implementations§

Source§

impl DType

Source

pub const BYTES: Self = _

The default DType for bytes

Source

pub const IDX: Self = _

The default DType for indices

Source

pub const IDX_32: Self = _

The DType for small indices (primarily created from bitmaps)

Source

pub fn nullability(&self) -> Nullability

Get the nullability of the DType

Source

pub fn is_nullable(&self) -> bool

Check if the DType is nullable

Source

pub fn as_nonnullable(&self) -> Self

Get a new DType with Nullability::NonNullable (but otherwise the same as self)

Source

pub fn as_nullable(&self) -> Self

Get a new DType with Nullability::Nullable (but otherwise the same as self)

Source

pub fn with_nullability(&self, nullability: Nullability) -> Self

Get a new DType with the given nullability (but otherwise the same as self)

Source

pub fn eq_ignore_nullability(&self, other: &Self) -> bool

Check if self and other are equal, ignoring nullability

Source

pub fn is_struct(&self) -> bool

Check if self is a StructDType

Source

pub fn is_unsigned_int(&self) -> bool

Check if self is an unsigned integer

Source

pub fn is_signed_int(&self) -> bool

Check if self is a signed integer

Source

pub fn is_int(&self) -> bool

Check if self is an integer (signed or unsigned)

Source

pub fn is_float(&self) -> bool

Check if self is a floating point number

Source

pub fn is_boolean(&self) -> bool

Check if self is a boolean

Source

pub fn as_struct(&self) -> Option<&StructDType>

Get the StructDType if self is a StructDType, otherwise None

Trait Implementations§

Source§

impl Clone for DType

Source§

fn clone(&self) -> DType

Returns a copy 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 DType

Source§

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

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

impl Display for DType

Source§

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

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

impl From<PType> for &DType

Source§

fn from(item: PType) -> Self

Converts to this type from the input type.
Source§

impl From<PType> for DType

Source§

fn from(item: PType) -> Self

Converts to this type from the input type.
Source§

impl Hash for DType

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 DType

Source§

fn eq(&self, other: &DType) -> 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 PartialOrd for DType

Source§

fn partial_cmp(&self, other: &DType) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<&DType> for PType

Source§

type Error = VortexError

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

fn try_from(value: &DType) -> VortexResult<Self>

Performs the conversion.
Source§

impl Eq for DType

Source§

impl StructuralPartialEq for DType

Auto Trait Implementations§

§

impl Freeze for DType

§

impl RefUnwindSafe for DType

§

impl Send for DType

§

impl Sync for DType

§

impl Unpin for DType

§

impl UnwindSafe for DType

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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§

default 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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T