4 releases

0.1.3 Feb 22, 2022
0.1.2 Feb 8, 2022
0.1.1 Feb 1, 2022
0.1.0 Feb 1, 2022

#25 in #derived

Download history 1/week @ 2024-07-22 48/week @ 2024-07-29 15/week @ 2024-08-05 6/week @ 2024-08-12 21/week @ 2024-08-19 5/week @ 2024-08-26 22/week @ 2024-09-09 9/week @ 2024-09-16 15/week @ 2024-09-23 10/week @ 2024-09-30 20/week @ 2024-10-07 14/week @ 2024-10-14 5/week @ 2024-10-21 11/week @ 2024-10-28 20/week @ 2024-11-04

52 downloads per month
Used in egui_inspect

MIT license

11KB
254 lines

egui_inspect

crates.io crates.io

This crate is intended to provide some rust helper macros to automatically generate boilerplate code to inspect structures

Its goals are:

  • to provide as much compile-time generated code as possible, avoiding conditional branches at runtime
  • to be hyper user-friendly

There is a EguiInspect trait which is necessary for a struct to be inspected. This trait is implemented for most base types, and can be generated for user created types with the macro #[derive(EguiInspect)]. If every underlying types implements EguiInspect, then you will be able to inspect it.

This is a side project, at a very early state, so the API might not be stable yet.

Example

img.png

You can inspect struct mutably and non-mutably. There is some customization per fields.

To implement this example, you just need to add egui_inspect as dependency to your project, and then, when drawing you ui with egui, you need to give your &Ui to the inspect function, no need for additional input . See example to see a complete integration with the eframe crate

Dependencies

~2MB
~45K SLoC