Skip to main content

plexus_substrate/activations/solar/
types.rs

1//! Solar system event types
2//!
3//! Domain types for the solar system activation.
4
5use schemars::JsonSchema;
6use serde::{Deserialize, Serialize};
7
8/// Events from solar system observations
9#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
10#[serde(tag = "type", rename_all = "snake_case")]
11pub enum SolarEvent {
12    /// Information about a celestial body
13    Body {
14        name: String,
15        body_type: BodyType,
16        mass_kg: f64,
17        radius_km: f64,
18        orbital_period_days: Option<f64>,
19        parent: Option<String>,
20    },
21    /// System overview
22    System {
23        star: String,
24        planet_count: usize,
25        moon_count: usize,
26        total_bodies: usize,
27    },
28}
29
30/// Type of celestial body
31#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
32#[serde(rename_all = "snake_case")]
33pub enum BodyType {
34    Star,
35    Planet,
36    DwarfPlanet,
37    Moon,
38}