pub trait TableRead: Send + Sync {
// Required methods
fn column_definitions(&self) -> Vec<ColumnDef>;
fn read_documents(&self) -> RwLockReadGuard<'_, Box<dyn DocumentStore>>;
fn maps_integer_keys(&self) -> bool;
// Provided method
fn for_each_indexed_fields(
&self,
ids: &[DocId],
fields: &[&str],
control: &StorageReadControl,
visitor: &mut dyn FnMut(DocId, bool, &[&Value]) -> bool,
) -> Result<Option<usize>, SQLError> { ... }
}Expand description
Only column definitions, shared document reads and the stored values that indexes hold are exposed. A scan cannot mutate catalog state, obtain an engine, or acquire a storage write guard.
Required Methods§
fn column_definitions(&self) -> Vec<ColumnDef>
fn read_documents(&self) -> RwLockReadGuard<'_, Box<dyn DocumentStore>>
Sourcefn maps_integer_keys(&self) -> bool
fn maps_integer_keys(&self) -> bool
Whether the table’s single integer primary key, if it has one, names its rows’ identities: every row whose key lies below KEY_IDENTITY_LIMIT has the identity equal to its key, and no other row has an identity below the limit. A table that does not keep this resolves its keys through the key’s index.
Provided Methods§
Sourcefn for_each_indexed_fields(
&self,
ids: &[DocId],
fields: &[&str],
control: &StorageReadControl,
visitor: &mut dyn FnMut(DocId, bool, &[&Value]) -> bool,
) -> Result<Option<usize>, SQLError>
fn for_each_indexed_fields( &self, ids: &[DocId], fields: &[&str], control: &StorageReadControl, visitor: &mut dyn FnMut(DocId, bool, &[&Value]) -> bool, ) -> Result<Option<usize>, SQLError>
Visit fields of the rows ids from index entries alone, in ids order and as a document store’s point projection reports them: each row, whether it exists, and its values when it does, while visitor returns true. Returns the rows visited, or None without visiting when the indexes do not hold every field. visitor runs while the index entries are lent and must not call back into the engine.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".