Crate brk_bindgen

Crate brk_bindgen 

Source

Modules§

javascript
JavaScript client generation.
python
Python client generation.
rust
Rust client generation.

Structs§

ChildContext
Pre-computed context for a single child node.
ClientConstants
Collected constant data for client generation.
ClientMetadata
Metadata extracted from brk_query for client generation.
ClientOutputPaths
Output path configuration for each language client.
CohortConstants
Cohort name constants - shared data definitions.
Endpoint
Endpoint information extracted from OpenAPI spec
GenericSyntax
Language-specific syntax for generic type annotations.
IndexSetPattern
A pattern of indexes that appear together on multiple metrics.
JavaScriptSyntax
JavaScript-specific code generation syntax.
Parameter
Parameter information
PatternBaseResult
Result of analyzing a pattern instance’s base.
PatternField
A field in a structural pattern.
PythonSyntax
Python-specific code generation syntax.
RustSyntax
Rust-specific code generation syntax.
StructuralPattern
A structural pattern - a branch structure that appears multiple times.
TreeNodeContext
Context for generating a tree node, returned by prepare_tree_node.

Enums§

PatternMode
How a pattern constructs metric names from the accumulator.

Constants§

MANUAL_GENERIC_TYPES
Types that are manually defined as generics in client code, not from schema.
VERSION

Traits§

LanguageSyntax
Language-specific syntax for code generation.

Functions§

analyze_pattern_modes
Analyze all pattern instances and determine their modes.
build_child_path
Build a child path by appending a child name to a parent path. Uses “/” as separator. If parent is empty, returns just the child name.
camel_case_keys
Convert top-level keys of a JSON object to camelCase.
child_type_name
Generate a child type/struct/class name (e.g., ParentName + child_name -> ParentName_ChildName).
detect_index_patterns
Detect index patterns (sets of indexes that appear together on metrics).
detect_structural_patterns
Detect structural patterns in the tree using a bottom-up approach.
escape_python_keyword
Escape Python reserved keywords by appending an underscore. Also prefixes names starting with digits with an underscore.
extract_endpoints
Extract all endpoints from OpenAPI spec
extract_inner_type
Extract inner type from a wrapper generic like Close<Dollars> -> Dollars. Also handles malformed types like Dollars> (from vecdb’s short_type_name).
extract_schemas
Extract type schemas from OpenAPI JSON
find_common_prefix
Find the longest common prefix among all strings. Returns the prefix WITH trailing underscore if found at word boundary. Returns None if no common prefix exists.
find_common_suffix
Find the longest common suffix among all strings. Returns the suffix WITH leading underscore if found at word boundary. Returns None if no common suffix exists.
format_json
Format a JSON value as a pretty-printed string.
generate_clients
Generate all client libraries from the query vecs and OpenAPI JSON.
generate_javascript_client
Generate JavaScript + JSDoc client from metadata and OpenAPI endpoints.
generate_leaf_field
Generate a leaf field using the actual metric name from the TreeNode::Leaf.
generate_parameterized_field
Generate a parameterized field using the language syntax.
generate_python_client
Generate Python client from metadata and OpenAPI endpoints.
generate_rust_client
Generate Rust client from metadata and OpenAPI endpoints.
generate_tree_node_field
Generate a tree node field with a specific child node for pattern instance base detection.
get_fields_with_child_info
Get fields with child field information for generic pattern lookup.
get_node_fields
Get the field signature for a branch node’s children.
get_pattern_instance_base
Get the metric base for a pattern instance by analyzing direct children.
get_union_variants
Get union variants from anyOf or oneOf schema.
index_to_field_name
Convert an Index to a snake_case field name (e.g., DateIndex -> dateindex).
infer_accumulated_name
Infer the accumulated name for a child node based on a descendant leaf name.
normalize_prefix
Normalize a prefix string by ensuring it ends with underscore. Returns empty string if input is empty.
normalize_return_type
Replace generic types with their Any variants in return types. Used by JS and Python generators.
parse_openapi_json
Parse OpenAPI spec from JSON string
prepare_tree_node
Prepare a tree node for generation. Returns None if the node should be skipped (not a branch, already generated, or matches a parameterizable pattern).
ref_to_type_name
Extract type name from a JSON Schema $ref path. E.g., “#/definitions/MyType” -> “MyType”, “#/$defs/Foo” -> “Foo”
to_camel_case
Convert a string to camelCase (e.g., “fee_rate” -> “feeRate”).
to_pascal_case
Convert a string to PascalCase (e.g., “fee_rate” -> “FeeRate”).
to_snake_case
Convert a string to snake_case, handling Rust keywords.
unwrap_allof
Unwrap allOf with a single element, returning the inner schema. Schemars uses allOf for composition, but often with just one $ref.
write_description
Write a multi-line description with the given prefix for each line. empty_prefix is used for blank lines (e.g., “ *“ without trailing space).

Type Aliases§

TypeSchemas
Type schema extracted from OpenAPI components