Skip to main content

Crate generate_rpc_diagrams

Crate generate_rpc_diagrams 

Source
Expand description

Generate Mermaid architecture diagrams from Cap’n Proto schema metadata and auto-detected service dependencies.

Usage: cargo run –bin generate-rpc-diagrams – [–metadata-dir PATH] [–services-dir PATH] [-o PATH]

Reads:

  • *_metadata.json files (from capnp build output) for method counts + scopes
  • services/factories.rs for service registrations, transport types, QUIC support
  • services/*.rs for client imports (auto-detected call graph)

Structs§

DepEdge 🔒
MethodCall 🔒
A detected method-level call from one caller to a target service method.
MethodDef 🔒
A method defined in a service’s schema.
ServiceMeta 🔒

Enums§

Transport 🔒

Constants§

CLIENT_TYPES 🔒
All known client/type names to scan for.

Functions§

build_method_registry 🔒
Parse all metadata files to build a method registry.
caller_id 🔒
Generate a stable node ID from a caller string.
client_to_service 🔒
Maps a client/type name found in source to the service it connects to.
extract_quoted 🔒
Extract the first quoted string from a line.
filename_to_service 🔒
Maps a source filename to the service it implements.
find_client_deps 🔒
Find client type references in a source file.
generate_call_graph 🔒
Generate the method-level call graph diagram.
generate_method_breakdown 🔒
generate_summary_table 🔒
generate_topology 🔒
has_client_prefix 🔒
Check if a line has a known client variable prefix before the method call. Matches patterns like: policy_client.check(, model_client.load(, registry.list(
main 🔒
parse_metadata 🔒
path_to_caller 🔒
Map a relative source path to a caller identity.
resolve_call_target 🔒
Resolve which service a method call targets based on context.
scan_factories 🔒
Parse factories.rs to extract service registrations with transport + QUIC.
scan_factory_body 🔒
Scan a factory function body to detect transport type and QUIC support.
scan_factory_dependencies 🔒
Scan factories.rs to detect which clients each factory function creates.
scan_method_calls 🔒
Scan all Rust source files for method-level calls to known service methods.
scan_service_sources 🔒
Scan services/*.rs files for client type usage to build call graph.
scope_name 🔒
service_label 🔒
title_case 🔒
to_snake_case 🔒
camelCase → snake_case conversion (e.g., “generateStream” → “generate_stream”)
walk_rs_files 🔒
Recursively walk .rs files.