packages

table::value

On this page

One cell, the element type of rows and the scalar of expressions.

Enums

ValueSource

pub enum Value

A single cell. A categorical cell reads as Str.

nabi
let v = table::Value::from(2.5);
assert(v.as_f64() == 2.5);
assert(f"{table::Value::Null}" == "null");
  • Int(i64)§

    Source
  • Float(f64)§

    Source
  • Bool(bool)§

    Source
  • Str(str)§

    Source
  • pub fn is_null(self) -> bool§

    Source

    true for Null.

  • pub fn dtype(self) -> DType | none§

    Source

    The type of a non-null value; none for Null.

  • pub fn as_i64(self) -> i64 | none§

    Source

    The integer, none for another kind.

  • pub fn as_f64(self) -> f64 | none§

    Source

    A number as f64 (an Int converts).

  • pub fn as_bool(self) -> bool | none§

    Source

    The bool, none for another kind.

  • pub fn as_str(self) -> str | none§

    Source

    The text, none for another kind.

  • pub fn as_date(self) -> Date | none§

    Source

    The date, none for another kind.

  • pub fn as_datetime(self) -> DateTime | none§

    Source

    The timestamp, none for another kind.

  • pub fn total_cmp(self, other: Value) -> Ordering§

    Source

    Total order for sorting: numbers by value (Int and Float compare as numbers, NaN last), then the other kinds; Null first. Mixed kinds order by kind.

Trait implementations 8
  • impl Display for Value
  • impl From<i64> for Value
  • impl From<i32> for Value
  • impl From<f64> for Value
  • impl From<bool> for Value
  • impl From<str> for Value
  • impl From<Date> for Value
  • impl From<DateTime> for Value