pub trait VTabCursor {
// Required methods
fn filter(
&mut self,
index_num: i32,
index_str: Option<&str>,
args: &mut [&mut ValueRef],
) -> Result<()>;
fn next(&mut self) -> Result<()>;
fn eof(&mut self) -> bool;
fn column(&mut self, idx: usize, context: &ColumnContext) -> Result<()>;
fn rowid(&mut self) -> Result<i64>;
}Expand description
Implementation of the cursor type for a virtual table.
Required Methods§
Sourcefn filter(
&mut self,
index_num: i32,
index_str: Option<&str>,
args: &mut [&mut ValueRef],
) -> Result<()>
fn filter( &mut self, index_num: i32, index_str: Option<&str>, args: &mut [&mut ValueRef], ) -> Result<()>
Begin a search of the virtual table. This method is always invoked after creating the cursor, before any other methods of this trait. After calling this method, the cursor should point to the first row of results (or eof should return true to indicate there are no results).
The index_num parameter is an arbitrary value which was passed to IndexInfo::set_index_num. The index_str parameter is an arbitrary value which was passed to IndexInfo::set_index_str.
Sourcefn eof(&mut self) -> bool
fn eof(&mut self) -> bool
Check if the cursor currently points beyond the end of the valid results.
Sourcefn column(&mut self, idx: usize, context: &ColumnContext) -> Result<()>
fn column(&mut self, idx: usize, context: &ColumnContext) -> Result<()>
Fetch the column numbered idx for the current row. The indexes correspond to the order the columns were declared by VTab::connect. The output value must be assigned to the context using ColumnContext::set_result. If no result is set, SQL NULL is returned. If this method returns an Err value, the SQL statement will fail, even if a result had been set before the failure.