Customize derives for libbpf-cargo generated types
Currently, there is no way to add custom derives to libbpf-cargo generated types.
My intended usage of this is to derive https://docs.rs/zerocopy/latest/zerocopy/trait.FromBytes.html for some generated structs to access them(which could come from bpf ringbuf as &[u8]) in a safe, zero-copy and idiomatic way in rust.
I am not sure there is a good way to inject custom derives. That being said, we have https://github.com/libbpf/libbpf-rs/issues/350 which would hopefully either make us come up with a general way for interpreting certain types as bytes or plug in some kind extension mechanism for interaction with other crates. Alas, this issue is a bit on the back burner right now.
That being said, if you have a different idea or want to look at #350, let us know.
fwiw another use case I could have for this - allow adding custom traits like https://docs.rs/fields-iter/latest/fields_iter/ to allow iterating the generated Progs, Links etc without taking a ref of the bpf_object holder.