snmp-parser icon indicating copy to clipboard operation
snmp-parser copied to clipboard

Improve API robustness and remove public dependencies

Open MattesWhite opened this issue 10 months ago • 1 comments

Hi, thanks for implementing this parser crate. It helps a lot. However, while including the crate in my business logic a found some unergonomic API designs that this PR tries to solve.

The main problem I found is that there are types of the crate's dependencies in the crate's public API. Namely, types from asn1-rs and nom. This required me to also depend on these crate to handle OIDs and to handle nom parser errors. But this gets problematic when versions between snmp-parser, asn1-rs and nom start to differ. Actually, there is already a difference between nom v7.0 used in snmp-parser and the current nom version v7.1.

This PR removes those public dependencies via re-export or returning std types instead. Feel free to cherry pick single commits. I'm also open to discuss alternative solutions.

MattesWhite avatar Apr 25 '24 07:04 MattesWhite