namib-project / nftables-rs

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

Add common traits to basic enums #32

Closed agarof closed 3 months ago

agarof commented 4 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 3 months ago

Looks good, LGTM.

@agarof thanks for your contribution!