Skip to main content

ColumnView

Enum ColumnView 

Source
pub enum ColumnView<'a> {
    Float(ArrayBase<ViewRepr<&'a f64>, Dim<IxDynImpl>>),
    Int(ArrayBase<ViewRepr<&'a i32>, Dim<IxDynImpl>>),
    Bool(ArrayBase<ViewRepr<&'a bool>, Dim<IxDynImpl>>),
    UInt(ArrayBase<ViewRepr<&'a u32>, Dim<IxDynImpl>>),
    U8(ArrayBase<ViewRepr<&'a u8>, Dim<IxDynImpl>>),
    String(ArrayBase<ViewRepr<&'a String>, Dim<IxDynImpl>>),
}
Expand description

A borrowed, read-only view of a Column.

Each variant holds an ArrayViewD that borrows from the corresponding ArrayD inside an owned Column. No data is copied.

Variants§

§

Float(ArrayBase<ViewRepr<&'a f64>, Dim<IxDynImpl>>)

Borrowed float column.

§

Int(ArrayBase<ViewRepr<&'a i32>, Dim<IxDynImpl>>)

Borrowed signed integer column.

§

Bool(ArrayBase<ViewRepr<&'a bool>, Dim<IxDynImpl>>)

Borrowed boolean column.

§

UInt(ArrayBase<ViewRepr<&'a u32>, Dim<IxDynImpl>>)

Borrowed unsigned integer column.

§

U8(ArrayBase<ViewRepr<&'a u8>, Dim<IxDynImpl>>)

Borrowed u8 column.

§

String(ArrayBase<ViewRepr<&'a String>, Dim<IxDynImpl>>)

Borrowed string column.

Implementations§

Source§

impl<'a> ColumnView<'a>

Source

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

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

Returns None if the array has rank 0.

Source

pub fn dtype(&self) -> DType

Returns the data type of this column view.

Source

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

Returns the shape of the underlying array view.

Source

pub fn as_float(&self) -> Option<ArrayBase<ViewRepr<&'a f64>, Dim<IxDynImpl>>>

Returns a view of the float data, or None if this column view is not Float.

Source

pub fn as_int(&self) -> Option<ArrayBase<ViewRepr<&'a i32>, Dim<IxDynImpl>>>

Returns a view of the integer data, or None if not Int.

Source

pub fn as_bool(&self) -> Option<ArrayBase<ViewRepr<&'a bool>, Dim<IxDynImpl>>>

Returns a view of the boolean data, or None if not Bool.

Source

pub fn as_uint(&self) -> Option<ArrayBase<ViewRepr<&'a u32>, Dim<IxDynImpl>>>

Returns a view of the unsigned integer data, or None if not UInt.

Source

pub fn as_u8(&self) -> Option<ArrayBase<ViewRepr<&'a u8>, Dim<IxDynImpl>>>

Returns a view of the u8 data, or None if not U8.

Source

pub fn as_string( &self, ) -> Option<ArrayBase<ViewRepr<&'a String>, Dim<IxDynImpl>>>

Returns a view of the string data, or None if not String.

Source

pub fn to_owned(&self) -> Column

Creates an owned Column by cloning the viewed data.

Trait Implementations§

Source§

impl ColumnAccess for ColumnView<'_>

Source§

fn as_float_view(&self) -> Option<ArrayBase<ViewRepr<&f64>, Dim<IxDynImpl>>>

Returns a float array view, or None if the column is not Float.
Source§

fn as_int_view(&self) -> Option<ArrayBase<ViewRepr<&i32>, Dim<IxDynImpl>>>

Returns an int array view, or None if the column is not Int.
Source§

fn as_bool_view(&self) -> Option<ArrayBase<ViewRepr<&bool>, Dim<IxDynImpl>>>

Returns a bool array view, or None if the column is not Bool.
Source§

fn as_uint_view(&self) -> Option<ArrayBase<ViewRepr<&u32>, Dim<IxDynImpl>>>

Returns a uint array view, or None if the column is not UInt.
Source§

fn as_u8_view(&self) -> Option<ArrayBase<ViewRepr<&u8>, Dim<IxDynImpl>>>

Returns a u8 array view, or None if the column is not U8.
Source§

fn as_string_view(&self) -> Option<ArrayBase<ViewRepr<&String>, Dim<IxDynImpl>>>

Returns a string array view, or None if the column is not String.
Source§

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

Returns the number of rows (axis-0 length), or None if rank 0.
Source§

fn dtype(&self) -> DType

Returns the data type of this column.
Source§

fn shape(&self) -> Vec<usize>

Returns the shape of the underlying array as an owned Vec.
Source§

impl Debug for ColumnView<'_>

Source§

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

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

impl<'a> From<&'a Column> for ColumnView<'a>

Source§

fn from(col: &'a Column) -> ColumnView<'a>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for ColumnView<'a>

§

impl<'a> RefUnwindSafe for ColumnView<'a>

§

impl<'a> Send for ColumnView<'a>

§

impl<'a> Sync for ColumnView<'a>

§

impl<'a> Unpin for ColumnView<'a>

§

impl<'a> UnsafeUnpin for ColumnView<'a>

§

impl<'a> UnwindSafe for ColumnView<'a>

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> 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, 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.