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
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
impl DType
Sourcepub fn nullability(&self) -> Nullability
pub fn nullability(&self) -> Nullability
Get the nullability of the DType
Sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Check if the DType is nullable
Sourcepub fn as_nonnullable(&self) -> Self
pub fn as_nonnullable(&self) -> Self
Get a new DType with Nullability::NonNullable (but otherwise the same as self)
Sourcepub fn as_nullable(&self) -> Self
pub fn as_nullable(&self) -> Self
Get a new DType with Nullability::Nullable (but otherwise the same as self)
Sourcepub fn with_nullability(&self, nullability: Nullability) -> Self
pub fn with_nullability(&self, nullability: Nullability) -> Self
Get a new DType with the given nullability (but otherwise the same as self)
Sourcepub fn eq_ignore_nullability(&self, other: &Self) -> bool
pub fn eq_ignore_nullability(&self, other: &Self) -> bool
Check if self and other are equal, ignoring nullability
Sourcepub fn is_unsigned_int(&self) -> bool
pub fn is_unsigned_int(&self) -> bool
Check if self is an unsigned integer
Sourcepub fn is_signed_int(&self) -> bool
pub fn is_signed_int(&self) -> bool
Check if self is a signed integer
Sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Check if self is a boolean
Sourcepub fn as_struct(&self) -> Option<&StructDType>
pub fn as_struct(&self) -> Option<&StructDType>
Get the StructDType if self is a StructDType, otherwise None
Sourcepub fn as_list_element(&self) -> Option<&DType>
pub fn as_list_element(&self) -> Option<&DType>
Get the inner dtype if self is a ListDType, otherwise None
Source§impl DType
impl DType
Sourcepub fn try_from_view(fb: DType<'_>, buffer: FlatBuffer) -> VortexResult<Self>
pub fn try_from_view(fb: DType<'_>, buffer: FlatBuffer) -> VortexResult<Self>
Create a new
Trait Implementations§
Source§impl From<DType> for FieldDType
impl From<DType> for FieldDType
Source§impl PartialOrd for DType
impl PartialOrd for DType
Source§impl TryFrom<&DType> for PType
impl TryFrom<&DType> for PType
Source§type Error = VortexError
type Error = VortexError
Source§fn try_from(value: &DType) -> VortexResult<Self>
fn try_from(value: &DType) -> VortexResult<Self>
Source§impl WriteFlatBuffer for DType
impl WriteFlatBuffer for DType
type Target<'a> = DType<'a>
fn write_flatbuffer<'fb>( &self, fbb: &mut FlatBufferBuilder<'fb>, ) -> WIPOffset<Self::Target<'fb>>
impl Eq for DType
impl FlatBufferRoot for DType
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> 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<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 moreSource§impl<F> WriteFlatBufferExt for Fwhere
F: WriteFlatBuffer + FlatBufferRoot,
impl<F> WriteFlatBufferExt for Fwhere
F: WriteFlatBuffer + FlatBufferRoot,
Source§fn write_flatbuffer_bytes(&self) -> ConstBuffer<u8, 8>
fn write_flatbuffer_bytes(&self) -> ConstBuffer<u8, 8>
FlatBuffer.