namib-project / nftables-rs

Safe abstraction for nftables JSON API (libnftables-json).
https://crates.io/crates/nftables
Apache License 2.0
32 stars 15 forks source link

Add common traits to basic enums #32

Closed agarof closed 6 months ago

agarof commented 7 months ago

This PR adds some common traits (Hash and Copy) from Rust's API guidelines to the crate's basic enum types.

I recently needed to create a HashMap using (String, NfFamily) as keys and couldn't since NfFamily didn't implement Hash. I added Copy as well for good measure since these enums are all 1 byte large.

jwhb commented 6 months ago

Looks good, LGTM.

@agarof thanks for your contribution!