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
//! Utility macros for common implementations across the `WaterUI` framework.
//!
//! This module provides macros that help reduce boilerplate code when implementing
//! common traits and patterns throughout the framework.
/// A macro for implementing `Debug` trait with simple type name formatting.
///
/// This macro generates a `Debug` implementation that outputs the type name
/// instead of the actual field values, which is useful for types that should
/// not expose their internal structure in debug output.
///
/// # Arguments
///
/// * `$ty` - The type for which to implement `Debug`.
///
/// # Example
///
/// ```rust
/// macro_rules! impl_debug {
/// ($ty:ty) => {
/// impl core::fmt::Debug for $ty {
/// fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
/// f.write_str(core::any::type_name::<Self>())
/// }
/// }
/// };
/// }
/// struct MyStruct {
/// private_field: String,
/// }
///
/// impl_debug!(MyStruct);
/// ```