1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! # egui_inspect
//! This crate expose macros and traits to generate boilerplate code
//! for structs inspection and edition.
//!
//! Basic usage would be
//! ```
//! # use egui_inspect::*;
//! #[derive(EguiInspect)]
//! struct MyApp {
//! #[inspect(no_edit)]
//! string: String,
//! #[inspect(multiline)]
//! code: String,
//! #[inspect(min = 12.0, max = 53.0)]
//! unsigned32: u32,
//! #[inspect(hide)]
//! skipped: bool,
//! #[inspect(custom_func_mut = "custom_bool_inspect")]
//! boolean: bool,
//! #[inspect(no_edit)]
//! raw_string: &'static str,
//! #[inspect(slider, min = -43.0, max = 125.0)]
//! float64: f32,
//! }
//!
//! fn custom_bool_inspect(boolean: &mut bool, label: &'static str, ui: &mut egui::Ui) {
//! ui.label("C'EST LA GIGA FONCTION CUSTOM WÉ");
//! boolean.inspect(label, ui);
//! }
//!
//! fn main() {
//! let app = MyApp::default();
//! app.inspect("My App", &ui); // here `ui` would be some `&mut egui::Ui`
//! }
//! ```
//!
//! You can add attributes to structures field.
//! Currently supported attributes are defined in the struct AttributeArgs of egui_inspect_derive
//!
//! Here is a list of supported attributes.
//! It might not be up to date, it's better to check directly AttributeArgs declaration
//!
//! - `hide` *(bool)*: If true, doesn't generate code for the given field
//! - `no_edit` *(bool)*: If true, never call mut function for the given field (May be overridden by other params)
//! - `slider` *(bool)*: If true, use a slider when inspecting numbers (`mut` only)
//! - `min` *(f32)*: Min value for inspecting numbers (`mut` only)
//! - `max` *(f32)*: Max value for inspecting numbers (`mut` only)
//! - `multiline` *(bool)*: If true, display the text on multiple lines (`mut` only)
//! - `custom_func` *(string)*: Use custom function for non-mut inspect (Evaluate the string as a function path)
//! - `custom_func_mut` *(string)*: Use custom function for mut inspect (Evaluate the string as a function path)
//!
/// See also [EguiInspect]
pub use *;
/// Base trait to automatically inspect structs