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

Function iter_procedures

crates/codegen/src/util.rs:126–137  ·  view source on GitHub ↗

Iterate over all the [`ProcedureDef`]s defined by the module, in alphabetical order by name. Skipping internal [`FunctionVisibiity::Internal`] procedures because they should not be directly invokable. Sorting is necessary to have deterministic reproducible codegen.

(
    module: &ModuleDef,
    visibility: CodegenVisibility,
)

Source from the content-addressed store, hash-verified

124/// directly invokable.
125/// Sorting is necessary to have deterministic reproducible codegen.
126pub(super) fn iter_procedures(
127 module: &ModuleDef,
128 visibility: CodegenVisibility,
129) -> impl Iterator<Item = &ProcedureDef> {
130 module
131 .procedures()
132 .sorted_by_key(|procedure| &procedure.name)
133 .filter(move |procedure| match visibility {
134 CodegenVisibility::IncludePrivate => true,
135 CodegenVisibility::OnlyPublic => !procedure.visibility.is_private(),
136 })
137}
138
139/// Iterate over all the [`TableDef`]s defined by the module, in alphabetical order by name.
140///

Callers 8

print_module_reexportsFunction · 0.85
generate_global_filesMethod · 0.85
collect_wrapper_typesFunction · 0.85
generate_global_filesMethod · 0.85
generate_procedures_fileFunction · 0.85

Calls 3

is_privateMethod · 0.80
filterMethod · 0.65
proceduresMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…