Skip to content

Commit 35e6ce9

Browse files
author
Pascal Hertleif
committed
Add simple docs to lib
1 parent ab4b352 commit 35e6ce9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
//! CAN DBC code generator for Rust
2+
//!
3+
//! DBC files are descriptions of CAN frames.
4+
//! See [this post](https://www.kvaser.com/developer-blog/an-introduction-j1939-and-dbc-files/)
5+
//! for an introduction.
6+
7+
#![deny(missing_docs)]
8+
19
use anyhow::{anyhow, Context, Result};
210
use can_dbc::{Message, Signal, ValDescription, ValueDescription, DBC};
311
use heck::{CamelCase, SnakeCase};
@@ -8,6 +16,7 @@ mod includes;
816
mod keywords;
917
mod pad;
1018

19+
/// Write Rust structs matching DBC input description to `out` buffer
1120
pub fn codegen(dbc_name: &str, dbc_content: &[u8], out: impl Write, debug: bool) -> Result<()> {
1221
let dbc = can_dbc::DBC::from_slice(dbc_content).map_err(|e| {
1322
let msg = "Could not parse dbc file";

0 commit comments

Comments
 (0)