Trait rusqlite::vtab::VTabCursor
source · pub unsafe trait VTabCursor: Sized {
// Required methods
fn filter(
&mut self,
idx_num: c_int,
idx_str: Option<&str>,
args: &Values<'_>
) -> Result<()>;
fn next(&mut self) -> Result<()>;
fn eof(&self) -> bool;
fn column(&self, ctx: &mut Context, i: c_int) -> Result<()>;
fn rowid(&self) -> Result<i64>;
}
Available on crate feature
vtab
only.Expand description
Virtual table cursor trait.
§Safety
Implementations must be like:
ⓘ
#[repr(C)]
struct MyTabCursor {
/// Base class. Must be first
base: rusqlite::vtab::sqlite3_vtab_cursor,
/* Virtual table implementations will typically add additional fields */
}
(See SQLite doc)
Required Methods§
sourcefn filter(
&mut self,
idx_num: c_int,
idx_str: Option<&str>,
args: &Values<'_>
) -> Result<()>
fn filter( &mut self, idx_num: c_int, idx_str: Option<&str>, args: &Values<'_> ) -> Result<()>
Begin a search of a virtual table. (See SQLite doc)
sourcefn next(&mut self) -> Result<()>
fn next(&mut self) -> Result<()>
Advance cursor to the next row of a result set initiated by
filter
. (See SQLite doc)
sourcefn eof(&self) -> bool
fn eof(&self) -> bool
Must return false
if the cursor currently points to a valid row of
data, or true
otherwise.
(See SQLite doc)
sourcefn column(&self, ctx: &mut Context, i: c_int) -> Result<()>
fn column(&self, ctx: &mut Context, i: c_int) -> Result<()>
Find the value for the i
-th column of the current row.
i
is zero-based so the first column is numbered 0.
May return its result back to SQLite using one of the specified ctx
.
(See SQLite doc)
sourcefn rowid(&self) -> Result<i64>
fn rowid(&self) -> Result<i64>
Return the rowid of row that the cursor is currently pointing at. (See SQLite doc)
Object Safety§
This trait is not object safe.