Struct ::exo::Table

Overview

Exolynk table which supports multiple columns and rows

Methods

fn new() -> Table

Creates a new empty Table.

Creates a new row at the top of the table (index 0). All existing rows will be pushed down by one row (index += 1).

let table = exo::Table::new();
table.new_row_top();
fn get_value(self, row: i64, ident: String) -> Option

Try to get a value from Table object. This function returns a specific value directly e.g. (String, Integer, DateTime, etc.)

fn set_value(self, row: i64, ident: String, value) -> Tuple

Sets a value at the specific row and columm inside the table. If the value you want to set is not valid, the insert will not happen.

fn remove_row(self, row: i64) -> Tuple

Removes an row from the table.

fn clear(self) -> Tuple

Clears the table of all entries

fn sort_asc(self, column: String) -> Tuple

Orders the table based upon the given column in an ascendig way.

Example

let table = exo::Table::new();
table.set_value(0, "A", "Test");
table.set_value(1, "A", 100);
table.set_value(2, "A", 50);
table.sort_asc("A");
assert_eq!(Some(50), table.get_value(0, "A"));
assert_eq!(Some(100), table.get_value(1, "A"));
assert_eq!(Some("Test"), table.get_value(2, "A"));
fn sort_desc(self, column: String) -> Tuple

Orders the table based upon the given column in an descending way.

Example

let table = exo::Table::new();
table.set_value(0, "A", "Test");
table.set_value(1, "A", 100);
table.set_value(2, "A", 50);
table.sort_desc("A");
assert_eq!(Some(100), table.get_value(0, "A"));
assert_eq!(Some(50), table.get_value(1, "A"));
assert_eq!(Some("Test"), table.get_value(2, "A"));
fn len(self) -> i64

Returns the amount of rows inside the table.

fn is_empty(self) -> bool

Returns true when there are no rows inside the table.

Protocols

protocol partial_eq
if value == b { }

Allows for partial equality operations to work.

protocol string_debug
println("{:?}", value)

Allows the value to be debug printed.

protocol string_display
println("{}", value)

Allows the value to be display printed.