[][src]Enum tubular::Column

pub enum Column {
    U32(Vec<u32>),
    U32Opt(Vec<Option<u32>>),
    I32(Vec<i32>),
    I32Opt(Vec<Option<i32>>),
    F32(Vec<f32>),
    F32Opt(Vec<Option<f32>>),
    Bool(Vec<bool>),
    BoolOpt(Vec<Option<bool>>),
    String(Vec<String>),
    StringOpt(Vec<Option<String>>),
}

Represents a single column in a DataFrame.

Columns are composed of 0 or more cells, all of a single type. Conceptually, columns come in two flavors: T and Option<T>. When all values are known to exist, the T flavor is much easier to work with.

Only some types can be used as cells in a Column -- types that implement ColumnType. An Iterator over items that impl ColumnType can be converted into a Column easily using the blanket impl of From as seen below.

Example:

use tubular::Column;

let column: Column = (&["apple", "banana", "orange"]).into();

You should never need to create a Column manually. Instead use push() to create a Column while adding it to a DataFrame.

Variants

U32(Vec<u32>)
U32Opt(Vec<Option<u32>>)
I32(Vec<i32>)
I32Opt(Vec<Option<i32>>)
F32(Vec<f32>)
F32Opt(Vec<Option<f32>>)
Bool(Vec<bool>)
BoolOpt(Vec<Option<bool>>)
String(Vec<String>)
StringOpt(Vec<Option<String>>)

Methods

impl Column[src]

pub fn len(&self) -> usize[src]

Number of cells in the Column.

use tubular::Column;

let column: Column = vec![
    Some("apple".to_string()),
    None,
    Some("banana".to_string())
].into();
assert_eq!(column.len(), 3);

Trait Implementations

impl Clone for Column[src]

impl Debug for Column[src]

impl<I: IntoIterator<Item = C>, C: ColumnType> From<I> for Column[src]

impl<'_> Into<Vec<String>> for &'_ Column[src]

impl PartialEq<Column> for Column[src]

impl StructuralPartialEq for Column[src]

Auto Trait Implementations

impl RefUnwindSafe for Column

impl Send for Column

impl Sync for Column

impl Unpin for Column

impl UnwindSafe for Column

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.