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

Function iter_tables

crates/codegen/src/util.rs:142–150  ·  view source on GitHub ↗

Iterate over all the [`TableDef`]s defined by the module, in alphabetical order by name. Sorting is necessary to have deterministic reproducible codegen.

(module: &ModuleDef, visibility: CodegenVisibility)

Source from the content-addressed store, hash-verified

140///
141/// Sorting is necessary to have deterministic reproducible codegen.
142pub(super) fn iter_tables(module: &ModuleDef, visibility: CodegenVisibility) -> impl Iterator<Item = &TableDef> {
143 module
144 .tables()
145 .filter(move |table| match visibility {
146 CodegenVisibility::IncludePrivate => true,
147 CodegenVisibility::OnlyPublic => table.table_access == TableAccess::Public,
148 })
149 .sorted_by_key(|table| &table.name)
150}
151
152/// Return the names of all private tables, in alphabetical order.
153pub fn private_table_names(module: &ModuleDef) -> Vec<String> {

Calls 2

filterMethod · 0.65
tablesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…