Skip to main content

zenkey_fleet/report/
interface.rs

1//! The interface plane: payload types and the carriers that move them —
2//! one type's producers, subjects and media streams in one document.
3
4use super::asked::Asked;
5use super::schema::SchemaRow;
6use serde::Serialize;
7
8#[derive(Debug, Clone, Serialize)]
9pub struct InterfaceTypeRow {
10    pub name: String,
11    pub carriers: usize,
12}
13
14#[derive(Debug, Clone, Serialize)]
15pub struct InterfaceList {
16    pub types: Vec<InterfaceTypeRow>,
17}
18
19#[derive(Debug, Clone, Serialize)]
20pub struct CarrierRow {
21    pub producer: String,
22    pub class: String,
23    pub path: String,
24}
25
26#[derive(Debug, Clone, Serialize)]
27pub struct InterfaceShow {
28    pub type_name: String,
29    pub carriers: Vec<CarrierRow>,
30    /// What each producer serving this type name says its schema is
31    /// (issue #51). `NotAsked` = `--schema` was not passed, so the bus was
32    /// never asked; `Asked(vec![])` = asked and no carrier served one — the
33    /// empty `Vec` used to conflate the two (RFC 09 §5.1 O4, review finding
34    /// R4). Two rows with different hashes *is* the RFC 08 §7 drift finding,
35    /// visible right here rather than only in `doctor`.
36    #[serde(skip_serializing_if = "Asked::is_not_asked", default)]
37    pub schemas: Asked<Vec<SchemaRow>>,
38}