MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / get_table

Method get_table

sdks/rust/src/client_cache.rs:361–368  ·  view source on GitHub ↗

Get a handle on the [`TableCache`] which stores rows of type `Row` for the table `table_name`.

(
        &self,
        table_name: &'static str,
    )

Source from the content-addressed store, hash-verified

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`].

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected