pub struct Table { /* private fields */ }
Expand description
A view into a single Realm database table.
Implementations§
Source§impl Table
impl Table
Sourcepub fn get_table_number(&self) -> usize
pub fn get_table_number(&self) -> usize
Get the number of the table, starting with 0, within the
Group
.
Subtables have a table number of usize::MAX
.
Sourcepub fn get_column_specs(&self) -> &[Box<dyn Column>]
pub fn get_column_specs(&self) -> &[Box<dyn Column>]
Get the column specifications for the table.
Sourcepub fn get_column_spec(&self, column_number: usize) -> Option<&dyn Column>
pub fn get_column_spec(&self, column_number: usize) -> Option<&dyn Column>
Get the specification for the column with the given number (starting with 0).
Returns an error if the column number is out of range.
Sourcepub fn row_count(&self) -> RealmResult<usize>
pub fn row_count(&self) -> RealmResult<usize>
Get the number of rows in the table.
Sourcepub fn get_row<'a>(&'a self, row_number: usize) -> RealmResult<Row<'a>>
pub fn get_row<'a>(&'a self, row_number: usize) -> RealmResult<Row<'a>>
Get the row with the given number (starting with 0).
Sourcepub fn find_row_number_from_indexed_column(
&self,
indexed_column_name: &str,
value: &Value,
) -> TableResult<Option<usize>>
pub fn find_row_number_from_indexed_column( &self, indexed_column_name: &str, value: &Value, ) -> TableResult<Option<usize>>
Determine the row number for the given value in an indexed column. Note that if there are multiple rows with the same value, this function will return the first one.
Returns an error if there is no column with the given name or if the column is not indexed.
Returns None
if the value is not found in the indexed column.
Sourcepub fn find_row_from_indexed_column<'a>(
&'a self,
indexed_column_name: &str,
value: &Value,
) -> TableResult<Option<Row<'a>>>
pub fn find_row_from_indexed_column<'a>( &'a self, indexed_column_name: &str, value: &Value, ) -> TableResult<Option<Row<'a>>>
Find and load the row with the given value in an indexed column. Note that if there are multiple rows with the same value, only the first one is returned.
Returns an error if there is no column with the given name or if the column is not indexed.
Returns None
if the value is not found in the indexed column.
Sourcepub fn get_rows<'a>(&'a self) -> RealmResult<Vec<Row<'a>>>
pub fn get_rows<'a>(&'a self) -> RealmResult<Vec<Row<'a>>>
Get all rows in the table.