use crate::ComponentId;
use bytes::Bytes;
use derive::FromValue;
use netidx_derive::Pack;
use serde::{Deserialize, Serialize};
use std::{collections::BTreeMap, sync::Arc};
use uuid::Uuid;
#[derive(Debug, Clone, Pack, FromValue, Serialize, Deserialize)]
pub enum SystemControlMessage {
Snapshot(SystemSnapshot),
DebugSnapshot(DebugSystemSnapshot), SymbologyReady,
Shutdown,
RestartComponent(ComponentId),
}
#[derive(Debug, Clone, Pack, Serialize, Deserialize)]
pub struct SystemSnapshot {
pub core_id: Uuid,
pub last_seqno: u64,
pub last_remote_seqno: BTreeMap<Uuid, u64>,
pub components: Arc<BTreeMap<ComponentId, (String, String, Bytes)>>,
}
#[derive(Debug, Clone, Pack, Serialize, Deserialize)]
pub struct DebugSystemSnapshot {
pub core_id: Uuid,
pub last_seqno: u64,
pub last_remote_seqno: BTreeMap<Uuid, u64>,
pub components: Arc<BTreeMap<ComponentId, (String, String, String)>>,
}