[−][src]Struct kiln::Table
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]
&self,
row: String,
col: String,
val: T,
old_val: ColumnValue
)
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(&self) -> 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
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,