pub trait Column: Debug + Send {
// Required methods
fn get(&self, index: usize) -> RealmResult<Value>;
fn is_null(&self, index: usize) -> RealmResult<bool>;
fn count(&self) -> RealmResult<usize>;
fn nullable(&self) -> bool;
fn is_indexed(&self) -> bool;
fn get_row_number_by_index(
&self,
lookup_value: &Value,
) -> RealmResult<Option<usize>>;
fn name(&self) -> Option<&str>;
}
Expand description
A column for a table.
Required Methods§
Sourcefn get(&self, index: usize) -> RealmResult<Value>
fn get(&self, index: usize) -> RealmResult<Value>
Get the value for this column for the row with the given index.
Sourcefn is_null(&self, index: usize) -> RealmResult<bool>
fn is_null(&self, index: usize) -> RealmResult<bool>
Check whether the value at the given index is null. Note that some
column types are never null, see Value
for details.
Sourcefn count(&self) -> RealmResult<usize>
fn count(&self) -> RealmResult<usize>
Get the total number of values in this column.
Sourcefn nullable(&self) -> bool
fn nullable(&self) -> bool
Get whether this column is nullable. Note that some column types are
never null, see Value
for details.
Sourcefn is_indexed(&self) -> bool
fn is_indexed(&self) -> bool
Is this column indexed? If so, you can use
table.find_row_from_indexed_column
to find rows by a known value based on this column.
Sourcefn get_row_number_by_index(
&self,
lookup_value: &Value,
) -> RealmResult<Option<usize>>
fn get_row_number_by_index( &self, lookup_value: &Value, ) -> RealmResult<Option<usize>>
Look up a value for this column in the index.
Panics if this column is not indexed.