pub trait 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(&self) -> Result<Self::Cursor>;
}
Expand description
Virtual table instance trait.
Implementations must be like:
ⓘ
#[repr(C)]
struct MyTab {
/// Base class. Must be first
base: ffi::sqlite3_vtab,
/* Virtual table implementations will typically add additional fields */
}
(See SQLite doc)
Required Associated Types§
type Aux
type Cursor: VTabCursor
Required Methods§
sourcefn connect(
db: &mut VTabConnection,
aux: Option<&Self::Aux>,
args: &[&[u8]]
) -> Result<(String, Self)>
fn connect(
db: &mut VTabConnection,
aux: Option<&Self::Aux>,
args: &[&[u8]]
) -> Result<(String, Self)>
Establish a new connection to an existing virtual table.
(See SQLite doc)
sourcefn 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)
sourcefn open(&self) -> Result<Self::Cursor>
fn open(&self) -> Result<Self::Cursor>
Create a new cursor used for accessing a virtual table. (See SQLite doc)