Skip to main content

Column

Trait Column 

Source
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§

Source

fn get(&self, index: usize) -> RealmResult<Value>

Get the value for this column for the row with the given index.

Source

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.

Source

fn count(&self) -> RealmResult<usize>

Get the total number of values in this column.

Source

fn nullable(&self) -> bool

Get whether this column is nullable. Note that some column types are never null, see Value for details.

Source

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.

Source

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.

Source

fn name(&self) -> Option<&str>

Get the name of this column. All columns except backlinks are named.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§