*.components.rs
Every pub struct is a component. A struct without pub is a shape the components use. Its
fields are always pub.
// types/body/body.components.rs
struct Vec3 {
pub x: f64,
pub y: f64,
pub z: f64,
}
/// Where the body is, and when that was sensed.
pub struct Pose {
pub position: Vec3,
pub rotation: [f64; 4],
pub sensed: f64,
}
/// The last depth look, as points.
pub struct Cloud {
pub points: Array<f32>,
pub sensed: f64,
}
| Write | Means |
|---|---|
f64 f32 u32 i32 | numbers |
String bool | text, a flag |
[f64; 3] | exactly that many |
Vec<T> | a list |
BTreeMap<String, T> | a map |
Array<f32> | a large array, held as memory |
Option<T> | may be absent |
Only structs with named fields, and no attributes but doc comments. The file is read, never
compiled — systems use the generated types at crate::schema::….