Adding to your project
Add Bomboni to yourCargo.toml file:
Cargo.toml
bomboni_common (identifiers and datetime) and bomboni_macros (helper macros).
Feature flags
Bomboni uses Cargo feature flags to enable optional functionality. This keeps your dependencies minimal and compile times fast.Core features
request
request
Enables API request parsing and validation utilities following Google AIP standards.Includes:
- Filter expression parsing (AIP-160 compliant)
- Query ordering and pagination
- List and search query builders
- Schema validation
Cargo.toml
derive
derive
Enables derive macros for request parsing and WASM bindings.Automatically enables:
bomboni_request/derivefor Parse derive macrobomboni_wasm/derivefor Wasm derive macro
Cargo.toml
prost
prost
Enables Protocol Buffer compilation utilities with prost.
Cargo.toml
proto
proto
Enables enhanced implementations of Google’s well-known protobuf types.Automatically enables the
prost feature.Cargo.toml
template
template
Enables Handlebars template rendering with custom helpers.
Cargo.toml
fs
fs
Enables file system utilities for recursive operations.
Cargo.toml
Serialization and async
serde
serde
Enables serde serialization and deserialization for Bomboni types.
Cargo.toml
tokio
tokio
Enables async APIs using the tokio runtime.
Cargo.toml
chrono
chrono
Enables conversion utilities between Bomboni’s
UtcDateTime and chrono’s datetime types.Cargo.toml
gRPC integration
tonic
tonic
Enables integration with the tonic gRPC library.Provides conversions between Bomboni and tonic types, including status codes and error handling.
Cargo.toml
Database support
postgres
postgres
Enables PostgreSQL type conversions and SQL generation.Provides:
- Type conversions for IDs and datetime
- SQL filter generation for PostgreSQL dialect
Cargo.toml
mysql
mysql
Enables MySQL type conversions and SQL generation.Provides:
- Type conversions for IDs and datetime
- SQL filter generation for MySQL dialect
Cargo.toml
WebAssembly support
wasm
wasm
Enables WebAssembly support and TypeScript declaration generation.Automatically enables the
serde feature for JavaScript interop.Cargo.toml
js
js
Enables JavaScript-specific type mappings and conversions.Use in combination with
wasm for better JavaScript integration.Cargo.toml
Common combinations
Here are some recommended feature combinations for different use cases:Using individual crates
You can also depend on individual Bomboni crates directly:Cargo.toml
Version compatibility
Bomboni follows semantic versioning:- 0.2.x - Current version, API may change
- Minimum Rust version - Rust 2024 edition (Rust 1.83+)
Bomboni uses the 2024 edition of Rust. Make sure your project uses
edition = "2024" in Cargo.toml or is compatible with 2024 edition dependencies.Next steps
Now that you have Bomboni installed, learn how to use it:Quickstart guide
Build your first application with Bomboni