Trait 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>;
}
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§

Source

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)

Source

fn next(&mut self) -> Result<()>

Advance cursor to the next row of a result set initiated by filter. (See SQLite doc)

Source

fn eof(&self) -> bool

Must return false if the cursor currently points to a valid row of data, or true otherwise. (See SQLite doc)

Source

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)

Source

fn rowid(&self) -> Result<i64>

Return the rowid of row that the cursor is currently pointing at. (See SQLite doc)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§