Add IndustryGroup, DeviceClass and FunctionCode#22
Add IndustryGroup, DeviceClass and FunctionCode#22Thom-de-Jong wants to merge 2 commits intoOpen-Agriculture:mainfrom
Conversation
| 88 => FunctionCode::ElectricPowerConverter, | ||
| 89 => FunctionCode::SupplyEquipmentCommunicationController, | ||
| 90 => FunctionCode::VehicleAdapterCommunicationController, | ||
| 128 => FunctionCode::Reserved, |
There was a problem hiding this comment.
There was a problem hiding this comment.
It is indeed a lot and i'm strugeling a bit finding a nice way to represent all of it.
At the moment it is just IG0 as you suspected.
| @@ -0,0 +1,1280 @@ | |||
| pub mod reader; | |||
There was a problem hiding this comment.
Might want to sequence this PR after the Object pool one #23 since the object pool files are in this one as well
| raw_name: u64, | ||
| } | ||
|
|
||
| impl NAME { |
There was a problem hiding this comment.
Idiomatically is it more "normal" in Rust to put this kind of thing in mod.rs rather than its own file? I'm just trying to figure out if name.rs was an abnormal thing to do over this where NAME's implementation is in mod.rs
There was a problem hiding this comment.
My personal preference is to put module structure in mod.rs and lib.rs files, where structure is
- module names
- module visibility
- symbol visibility
and to leave the implementation of those symbols in separate files. My opinion is mostly based on having the ability to do so, which is a breath of fresh air coming from C++ and Python 😆. I'm unsure if my perceived benefits of "better understanding the structure of the module" is actually realized in practice.
This is not an opinion it seems the open-source Rust community shares, based on digging through various open source Rust crates.
So, my short answer is: It's normal and fine to put the implementations wherever - as long as it results in a sane public-facing API.
There was a problem hiding this comment.
In rust it does not really mater but as you pointed out, putting the implementation insize of a file called name.rs would make the structure more clear.

Instead of working with the u8 values, you now use enum types.
Also added the NameFilter concept from AgIsoStack++