The main issue I want to address is that the generated code currently contains the CanError enum. I have multiple DBC files for different can buses that I would like to abstract in a single crate, but having multiple equal but distinct CanError types makes this really annoying.
To solve this I think it would be good to introduce a separate runtime crate. This crate can then hold common types and also re-export the additional dependencies used by the extra code.
The latter can be done through a hidden module like:
#[doc(hidden)]
mod __priv {
pub use bitvec;
// [...]
}
I'm happy to work on an initial implementation if we're happy with this approach.
35 is exactly the use case I wanted to use this crate for initially. I have a repository of dbc files and I wanted to just iterate over all of them, generate a crate for each one, and publish them to an internal registry.
The main issue I want to address is that the generated code currently contains the
CanError
enum. I have multiple DBC files for different can buses that I would like to abstract in a single crate, but having multiple equal but distinctCanError
types makes this really annoying.To solve this I think it would be good to introduce a separate runtime crate. This crate can then hold common types and also re-export the additional dependencies used by the extra code. The latter can be done through a hidden module like:
I'm happy to work on an initial implementation if we're happy with this approach.