#[derive(ProbarComponent)]
{
// Attributes available to this derive:
#[probar]
}
Expand description
Derive macro for type-safe component inspection.
Generates the ProbarComponent trait implementation which provides:
component_name()- Returns the canonical string namecomponent_type_id()- Returns a unique type identifierfield_names()- Returns field names for inspectionfrom_bytes()- Deserialize from WASM memory (zero-copy where possible)
§Attributes
#[probar(name = "custom_name")]- Override the component name#[probar(skip)]- Skip a field from inspection
§Example
ⓘ
#[derive(ProbarComponent)]
struct Position {
x: f32,
y: f32,
#[probar(skip)]
_internal: u32,
}
// Now usable as:
let pos: Position = game.component::<Position>(entity)?;