Skip to main content

Column

Enum Column 

Source
pub enum Column {
    Float(ArrayD<F>),
    Int(ArrayD<I>),
    Bool(ArrayD<bool>),
    UInt(ArrayD<U>),
    U8(ArrayD<u8>),
    String(ArrayD<String>),
}
Expand description

Internal enum representing a column of data in a Block.

This type is exposed in the public API but users typically don’t need to interact with it directly. Instead, use the type-specific getters like get_float(), get_int(), etc.

Variants§

§

Float(ArrayD<F>)

Floating point column using the compile-time scalar type F.

§

Int(ArrayD<I>)

Signed integer column using the compile-time scalar type I.

§

Bool(ArrayD<bool>)

Boolean column

§

UInt(ArrayD<U>)

Unsigned integer column using the compile-time scalar type U.

§

U8(ArrayD<u8>)

8-bit unsigned integer column

§

String(ArrayD<String>)

String column

Implementations§

Source§

impl Column

Source

pub fn nrows(&self) -> Option<usize>

Returns the number of rows (axis-0 length) of this column.

Returns None if the array has rank 0 (which should never happen in a valid Block, as rank-0 arrays are rejected during insertion).

Source

pub fn dtype(&self) -> DType

Returns the data type of this column.

Source

pub fn shape(&self) -> &[usize]

Returns the shape of the underlying array.

Source

pub fn as_float(&self) -> Option<&ArrayD<F>>

Returns a reference to the float data, or None if this column is not Float.

Source

pub fn as_float_mut(&mut self) -> Option<&mut ArrayD<F>>

Returns a mutable reference to the float data, or None if not Float.

Source

pub fn as_int(&self) -> Option<&ArrayD<I>>

Returns a reference to the integer data, or None if not Int.

Source

pub fn as_int_mut(&mut self) -> Option<&mut ArrayD<I>>

Returns a mutable reference to the integer data, or None if not Int.

Source

pub fn as_bool(&self) -> Option<&ArrayD<bool>>

Returns a reference to the boolean data, or None if not Bool.

Source

pub fn as_bool_mut(&mut self) -> Option<&mut ArrayD<bool>>

Returns a mutable reference to the boolean data, or None if not Bool.

Source

pub fn as_uint(&self) -> Option<&ArrayD<U>>

Returns a reference to the unsigned integer data, or None if not UInt.

Source

pub fn as_uint_mut(&mut self) -> Option<&mut ArrayD<U>>

Returns a mutable reference to the unsigned integer data, or None if not UInt.

Source

pub fn as_u8(&self) -> Option<&ArrayD<u8>>

Returns a reference to the u8 data, or None if not U8.

Source

pub fn as_u8_mut(&mut self) -> Option<&mut ArrayD<u8>>

Returns a mutable reference to the u8 data, or None if not U8.

Source

pub fn as_string(&self) -> Option<&ArrayD<String>>

Returns a reference to the string data, or None if not String.

Source

pub fn as_string_mut(&mut self) -> Option<&mut ArrayD<String>>

Returns a mutable reference to the string data, or None if not String.

Source

pub fn resize(&mut self, new_nrows: usize)

Resize this column along axis 0 to new_nrows.

  • If new_nrows < current nrows, slices to keep only the first new_nrows rows.
  • If new_nrows > current nrows, extends with default values (0.0 for Float, 0 for Int/UInt/U8, false for Bool, empty string for String).
  • If new_nrows == current nrows, this is a no-op.

Only axis 0 is modified; trailing dimensions are preserved.

Trait Implementations§

Source§

impl Clone for Column

Source§

fn clone(&self) -> Column

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 Column

Source§

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

Formats the value using the given formatter. Read more

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<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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V