Trait rusqlite::vtab::VTab [−][src]
pub unsafe trait VTab<'vtab>: Sized {
type Aux;
type Cursor: VTabCursor;
fn connect(
db: &mut VTabConnection,
aux: Option<&Self::Aux>,
args: &[&[u8]]
) -> Result<(String, Self)>;
fn best_index(&self, info: &mut IndexInfo) -> Result<()>;
fn open(&'vtab self) -> Result<Self::Cursor>;
}
This is supported on crate feature
vtab
only.Expand description
Virtual table instance trait.
Safety
The first item in a struct implementing VTab must be
rusqlite::sqlite3_vtab
, and the struct must be #[repr(C)]
.
ⓘ
#[repr(C)]
struct MyTab {
/// Base class. Must be first
base: rusqlite::vtab::sqlite3_vtab,
/* Virtual table implementations will typically add additional fields */
}
(See SQLite doc)
Associated Types
Client data passed to Connection::create_module
.
type Cursor: VTabCursor
type Cursor: VTabCursor
Specific cursor implementation
Required methods
Establish a new connection to an existing virtual table.
(See SQLite doc)
fn best_index(&self, info: &mut IndexInfo) -> Result<()>
fn best_index(&self, info: &mut IndexInfo) -> Result<()>
Determine the best way to access the virtual table. (See SQLite doc)
Create a new cursor used for accessing a virtual table. (See SQLite doc)