2026-04-24 13:37:30 -06:00
|
|
|
//! Required introspection payloads for discovery.
|
2026-04-24 12:32:24 -06:00
|
|
|
|
|
|
|
|
use alloc::{string::String, vec::Vec};
|
|
|
|
|
use rkyv::{Archive, Deserialize, Serialize};
|
|
|
|
|
|
|
|
|
|
/// Reserved procedure id for protocol introspection.
|
2026-04-26 01:53:37 -06:00
|
|
|
///
|
|
|
|
|
/// The protocol uses the empty string here so discovery traffic stays outside the normal
|
|
|
|
|
/// application procedure namespace. [`crate::protocol::validate_procedure_id`] reserves that
|
|
|
|
|
/// value exclusively for introspection.
|
2026-04-24 12:32:24 -06:00
|
|
|
pub const INTROSPECTION_PROCEDURE_ID: &str = "";
|
|
|
|
|
|
|
|
|
|
/// Endpoint-wide introspection payload.
|
|
|
|
|
#[derive(Archive, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct EndpointIntrospection {
|
2026-04-26 01:53:37 -06:00
|
|
|
/// Direct child endpoint segment names hosted immediately below this endpoint.
|
2026-04-25 11:27:29 -06:00
|
|
|
pub sub_endpoints: Vec<String>,
|
2026-04-26 01:53:37 -06:00
|
|
|
/// Leaf summaries hosted directly at this endpoint.
|
2026-04-24 12:32:24 -06:00
|
|
|
pub leaves: Vec<LeafIntrospectionSummary>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Shared per-leaf discovery record.
|
|
|
|
|
#[derive(Archive, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct LeafIntrospectionSummary {
|
2026-04-26 01:53:37 -06:00
|
|
|
/// Canonical dotted leaf identifier.
|
2026-04-24 12:32:24 -06:00
|
|
|
pub leaf_name: String,
|
2026-04-26 01:53:37 -06:00
|
|
|
/// Exhaustive canonical procedure ids currently exposed by the leaf.
|
2026-04-24 12:32:24 -06:00
|
|
|
pub procedures: Vec<String>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Leaf-specific introspection payload.
|
2026-04-26 01:53:37 -06:00
|
|
|
///
|
|
|
|
|
/// This duplicates [`LeafIntrospectionSummary`] intentionally because the leaf-only response is
|
|
|
|
|
/// a distinct wire payload from the endpoint-wide discovery response.
|
2026-04-24 12:32:24 -06:00
|
|
|
#[derive(Archive, Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
|
|
|
|
pub struct LeafIntrospection {
|
2026-04-26 01:53:37 -06:00
|
|
|
/// Canonical dotted leaf identifier.
|
2026-04-24 12:32:24 -06:00
|
|
|
pub leaf_name: String,
|
2026-04-26 01:53:37 -06:00
|
|
|
/// Exhaustive canonical procedure ids currently exposed by the leaf.
|
2026-04-24 12:32:24 -06:00
|
|
|
pub procedures: Vec<String>,
|
|
|
|
|
}
|