Get a handle on the [`TableCache`] which stores rows of type `Row` for the table `table_name`.
(
&self,
table_name: &'static str,
)
| 359 | |
| 360 | /// Get a handle on the [`TableCache`] which stores rows of type `Row` for the table `table_name`. |
| 361 | pub(crate) fn get_table<Row: InModule<Module = M> + Send + Sync + 'static>( |
| 362 | &self, |
| 363 | table_name: &'static str, |
| 364 | ) -> Option<&TableCache<Row>> { |
| 365 | self.tables |
| 366 | .get::<HashMap<&'static str, TableCache<Row>>>() |
| 367 | .and_then(|tables_of_row_type| tables_of_row_type.get(table_name)) |
| 368 | } |
| 369 | |
| 370 | /// Called internally when updating the client cache in response to WebSocket messages, |
| 371 | /// and by the codegen when initializing the client cache during [`crate::DbConnectionBuilder::build`]. |