TableVirtualUser

Trait TableVirtualUser 

Source
pub trait TableVirtualUser:
    Send
    + Sync
    + 'static {
    // Required methods
    fn columns(&self) -> Vec<TableVirtualUserColumnDef>;
    fn rows(&self) -> Vec<Vec<Value>>;
}
Expand description

Simple trait for user-defined virtual tables.

Implement this trait when your virtual table can return all rows at once. For large datasets that should be streamed, implement TableVirtualUserIterator instead.

§Thread Safety

Implementations must be thread-safe (Send + Sync) as the same table instance may be queried concurrently from multiple transactions.

Required Methods§

Source

fn columns(&self) -> Vec<TableVirtualUserColumnDef>

Return the column definitions for this table.

Source

fn rows(&self) -> Vec<Vec<Value>>

Generate all rows for the table.

Each inner Vec<Value> represents one row, with values in the same order as the columns returned by columns().

Implementors§