libbpf-rs icon indicating copy to clipboard operation
libbpf-rs copied to clipboard

Derive Debug

Open mdaverde opened this issue 2 years ago • 3 comments

Possible to derive Debug trait output for some of the public-facing structs?

Besides the ability to debug from the output, when we build higher-level structs that use libbpf-rs's types internally, we can't derive Debug for our custom structs because we get a compiler error notifying us that libbpf-rs's types themselves don't implement Debug.

It seems like we already do this for some structs but not others.

mdaverde avatar Aug 28 '22 16:08 mdaverde

Agreed, we most likely should do that.

danielocfb avatar Aug 29 '22 16:08 danielocfb

@mdaverde Are you interested in creating a pull request adding these derives? Should probably include warning on the missing_debug_implementations lint.

danielocfb avatar Sep 01 '22 17:09 danielocfb

With https://github.com/libbpf/libbpf-rs/pull/266 merged the scope of this issue got reduced to adding a few more Debug implementations to structs containing pointers.

danielocfb avatar Sep 08 '22 16:09 danielocfb