#[component]Expand description
Marks a struct as a component
Automatically derives:
Debug- Required by Component traitClone- Useful for component copyingPartialEq- Useful for testing and comparison
Also adds #[allow(dead_code)] to prevent warnings on unused fields.
§Example
ⓘ
#[component]
struct Position {
x: f32,
y: f32,
}
// Expands to:
#[derive(Debug, Clone, PartialEq)]
#[allow(dead_code)]
struct Position {
x: f32,
y: f32,
}§Requirements
Component types must be:
- Simple structs (no enums or unions)
- All fields must implement Debug, Clone, PartialEq