Skip to main content

VTable

Trait VTable 

Source
pub trait VTable {
    type Cursor: VTabCursor<Error = Self::Error>;
    type Error: Display;

    // Required method
    fn open(
        &self,
        _conn: Option<Arc<Connection>>,
    ) -> Result<Self::Cursor, Self::Error>;

    // Provided methods
    fn update(
        &mut self,
        _rowid: i64,
        _args: &[Value],
    ) -> Result<(), Self::Error> { ... }
    fn insert(&mut self, _args: &[Value]) -> Result<i64, Self::Error> { ... }
    fn delete(&mut self, _rowid: i64) -> Result<(), Self::Error> { ... }
    fn destroy(&mut self) -> Result<(), Self::Error> { ... }
    fn best_index(
        _constraints: &[ConstraintInfo],
        _order_by: &[OrderByInfo],
    ) -> IndexInfo { ... }
}

Required Associated Types§

Source

type Cursor: VTabCursor<Error = Self::Error>

Source

type Error: Display

Required Methods§

Source

fn open( &self, _conn: Option<Arc<Connection>>, ) -> Result<Self::Cursor, Self::Error>

‘conn’ is an Option to allow for testing. Otherwise a valid connection to the core database that created the virtual table will be available to use in your extension here.

Provided Methods§

Source

fn update(&mut self, _rowid: i64, _args: &[Value]) -> Result<(), Self::Error>

Source

fn insert(&mut self, _args: &[Value]) -> Result<i64, Self::Error>

Source

fn delete(&mut self, _rowid: i64) -> Result<(), Self::Error>

Source

fn destroy(&mut self) -> Result<(), Self::Error>

Source

fn best_index( _constraints: &[ConstraintInfo], _order_by: &[OrderByInfo], ) -> IndexInfo

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§