[][src]Struct kiln::Table

pub struct Table {
    pub spec: TableSpec,
    // some fields omitted
}

Fields

spec: TableSpec

Methods

impl Table[src]

pub fn insert(&self, value: HashMap<String, ColumnValue>) -> Result<Row, Error>[src]

Insert a row into a Table. Rows can be constructed as HashMaps or using the row! macro as shown bellow:

users.insert(row!{name: "bob", age: 12});

Or manually by creating a HashMap<String, ColumnValue> object

pub fn get<T: ToCell>(&self, key: &str, v: T) -> Vec<Row>[src]

Gets all rows where a certain key == a certain value. For example, in the following table

| age: i32 | name: str |

To get the names of all users of age n one would do the following

users.get("age", n.to_col());

pub fn get_one<T: ToCell>(&self, key: &str, v: T) -> Option<Row>[src]

pub fn row(&self, id: &str) -> Row[src]

Returns a row from it's ID

pub fn set_cell<T: ToCell>(
    &self,
    row: String,
    col: String,
    val: T,
    old_val: ColumnValue
)
[src]

Set a cell to a value. Takes the row, column, value, and old value as arguments and panics if it fails. It is not recommended to use this function, you should use the row.set(k, v) function instead.

Trait Implementations

impl PartialEq<Table> for Table[src]

impl Clone for Table[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Table[src]

Auto Trait Implementations

impl Send for Table

impl Sync for Table

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.