Skip to main content

Data

Enum Data 

Source
#[non_exhaustive]
pub enum Data {
Show 16 variants Empty, Bool(Vec<bool>), Int8(Vec<i8>), Int16(Vec<i16>), Int32(Vec<i32>), Int64(Vec<i64>), Int128(Vec<i128>), UInt8(Vec<u8>), UInt16(Vec<u16>), UInt32(Vec<u32>), UInt64(Vec<u64>), UInt128(Vec<u128>), Float32(Vec<f32>), Float64(Vec<f64>), Interval(Vec<(i32, i32, i64)>), Varlen(StringColumn),
}
Expand description

The values of a flat vector, one Rust vector per physical type.

The variants are physical rather than logical, which is what lets DATE and INTEGER share storage and share a kernel. What a run of i32 means is the vector’s logical type’s business.

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

No values, for the type of an untyped NULL.

§

Bool(Vec<bool>)

One byte per value.

§

Int8(Vec<i8>)

8 bit signed.

§

Int16(Vec<i16>)

16 bit signed.

§

Int32(Vec<i32>)

32 bit signed.

§

Int64(Vec<i64>)

64 bit signed.

§

Int128(Vec<i128>)

128 bit signed.

§

UInt8(Vec<u8>)

8 bit unsigned.

§

UInt16(Vec<u16>)

16 bit unsigned.

§

UInt32(Vec<u32>)

32 bit unsigned.

§

UInt64(Vec<u64>)

64 bit unsigned.

§

UInt128(Vec<u128>)

128 bit unsigned.

§

Float32(Vec<f32>)

IEEE 754 binary32.

§

Float64(Vec<f64>)

IEEE 754 binary64.

§

Interval(Vec<(i32, i32, i64)>)

The months, days and microseconds triple.

§

Varlen(StringColumn)

Strings, as 16 byte views plus the blocks the long ones live in.

Implementations§

Source§

impl Data

Source

pub fn len(&self) -> usize

How many values are stored.

Source

pub fn is_empty(&self) -> bool

Whether there are no values.

Source

pub fn signed_at(&self, index: usize) -> Option<i128>

An integer at index, widened, for any of the signed integer layouts.

Used by the decimal path, which needs the unscaled value out of whichever width the width and scale picked, and by anything else that would otherwise repeat the same five arms.

Source

pub fn unsigned_at(&self, index: usize) -> Option<u128>

An unsigned integer at index, widened.

Source

pub fn str_at(&self, index: usize) -> Option<&str>

The string at index, for a Varlen.

Trait Implementations§

Source§

impl Clone for Data

Source§

fn clone(&self) -> Data

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Data

Source§

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

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

impl PartialEq for Data

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Data

Auto Trait Implementations§

§

impl Freeze for Data

§

impl RefUnwindSafe for Data

§

impl Send for Data

§

impl Sync for Data

§

impl Unpin for Data

§

impl UnsafeUnpin for Data

§

impl UnwindSafe for Data

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.