Skip to content

A Rust workspace containing the DBC (CAN Database) file parser library and command-line tools.

Notifications You must be signed in to change notification settings

reneherrero/dbc-rs

Repository files navigation

dbc-rs

dbc-rs CI dbc-cli CI License

A Rust workspace containing the DBC (CAN Database) file parser library and command-line tools.

Projects

The core library for parsing, editing, and writing DBC files. Supports both std and no_std environments.

Features:

  • Zero dependencies - Pure Rust implementation
  • no_std + alloc support - Works on embedded targets without the standard library
  • Full editing & writing - Modify and save DBC files with the same structs
  • Feature flag control - Optional std feature for desktop conveniences
  • Internationalized errors - Build-time language selection (English, French, Spanish, German, Japanese)
  • Comprehensive validation - Signal overlap detection, boundary checking, and more
  • Well tested - Tested with real-world DBC files

Command-line interface for working with DBC files.

Features:

  • Version information
  • DBC file manipulation (coming soon)

Quick Start

Using the Library

Add to your Cargo.toml:

[dependencies]
dbc-rs = { path = "./dbc" }

Using the CLI

cargo run --bin dbc-cli -- version

Building

Build all workspace members:

cargo build

Build without default features (no_std):

cargo build --no-default-features

Testing

Run all tests:

cargo test

Code Coverage

Code coverage is tracked automatically in CI. To check coverage locally:

# Install cargo-llvm-cov using prebuilt binary (recommended)
host=$(rustc -vV | grep '^host:' | cut -d' ' -f2)
curl --proto '=https' --tlsv1.2 -fsSL \
  "https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-$host.tar.gz" \
  | tar xzf - -C "$HOME/.cargo/bin"

# Generate coverage report
cargo llvm-cov --all-features --workspace

# Generate HTML report (opens in browser)
cargo llvm-cov --all-features --workspace --html

Note: Prebuilt binaries are recommended because cargo install may fail with MSRV (1.85.0). CI uses latest stable Rust and works automatically.

The project aims for at least 80% code coverage. Coverage reports are automatically generated in CI and posted as PR comments.

Security

For a comprehensive security audit, see SECURITY.md.

License

Licensed under either of:

at your option.

For commercial licensing, see LICENSING.md.

About

A Rust workspace containing the DBC (CAN Database) file parser library and command-line tools.

Topics

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages