pub struct TableCache { /* private fields */ }Expand description
Cache for managing multiple table stores.
Implementations§
Source§impl TableCache
impl TableCache
Sourcepub fn create_table(&mut self, schema: Table) -> Result<()>
pub fn create_table(&mut self, schema: Table) -> Result<()>
Creates a table in the cache.
Sourcepub fn drop_table(&mut self, name: &str) -> Result<()>
pub fn drop_table(&mut self, name: &str) -> Result<()>
Drops a table from the cache.
Sourcepub fn get_table_mut(&mut self, name: &str) -> Option<&mut RowStore>
pub fn get_table_mut(&mut self, name: &str) -> Option<&mut RowStore>
Gets a mutable reference to a table store.
Sourcepub fn table_count(&self) -> usize
pub fn table_count(&self) -> usize
Returns the number of tables.
Sourcepub fn table_names(&self) -> Vec<&str>
pub fn table_names(&self) -> Vec<&str>
Returns all table names.
Sourcepub fn total_row_count(&self) -> usize
pub fn total_row_count(&self) -> usize
Returns the total row count across all tables.
Sourcepub fn get_row(&self, table: &str, row_id: RowId) -> Option<Rc<Row>>
pub fn get_row(&self, table: &str, row_id: RowId) -> Option<Rc<Row>>
Gets a row by table name and row ID.
Sourcepub fn get_many(&self, table: &str, row_ids: &[RowId]) -> Vec<Option<Rc<Row>>>
pub fn get_many(&self, table: &str, row_ids: &[RowId]) -> Vec<Option<Rc<Row>>>
Gets multiple rows by table name and row IDs.
Sourcepub fn clear_table(&mut self, name: &str) -> Result<()>
pub fn clear_table(&mut self, name: &str) -> Result<()>
Clears a specific table.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TableCache
impl RefUnwindSafe for TableCache
impl !Send for TableCache
impl !Sync for TableCache
impl Unpin for TableCache
impl UnwindSafe for TableCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more