#[non_exhaustive]pub struct CatalogEntry {Show 15 fields
pub module_id: String,
pub ready: bool,
pub not_ready: Option<NotReadyReason>,
pub module_version: Option<String>,
pub roles: Vec<ProviderRole>,
pub control_ops: Vec<String>,
pub capabilities: Option<CapabilityDeclarations>,
pub self_signals: Option<Vec<SelfSignalDeclaration>>,
pub events: Option<Vec<EventDeclaration>>,
pub operation_delivery: BTreeMap<String, OperationDelivery>,
pub operation_payload: BTreeMap<String, OperationPayload>,
pub flow_operations: Option<Vec<String>>,
pub rich_ui: Option<RichUiDescriptor>,
pub role_declarations: BTreeMap<String, Map<String, Value>>,
pub nonce_verified: bool,
}Expand description
A registered module’s catalog projection.
Use CatalogEntry::new and its with_* methods to construct entries so
future fields do not require changes to callers.
Struct literals and functional record updates are not supported outside this crate:
use subc_control::CatalogEntry;
let entry = CatalogEntry::new("provider", vec![], vec![]);
let entry = CatalogEntry { ready: false, ..entry };Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.module_id: String§ready: boolWhether the registered module currently accepts new route binds.
This is the module’s EFFECTIVE readiness: its own declared readiness
AND every one of its need: required capabilities having a registered
provider. It is exactly the condition route.open checks, so a caller
reading false here will be refused with module_warming; not_ready
says why.
Older daemons omit this field and are interpreted as ready. Daemons that
predate not_ready report declared readiness only.
not_ready: Option<NotReadyReason>Why ready is false, in the same shape route.open puts in the
detail of its module_warming refusal. Absent when the module is
ready, and absent from daemons that predate the field.
module_version: Option<String>The registered module’s self-declared build version, projected from its manifest so a consumer can tell WHICH BUILD of a module it is talking to at connect time.
Without this, a client compiled against a module’s current source reads a contract that is true of the repository and false of the running process – the types match, the JSON decodes, and the meaning has changed. That failure carries no error to notice; the version in the catalog turns a semantic skew into a log line at connect instead of a wrong sentence on a user’s screen.
Optional on the wire only because entries serialized by older daemons lack it: absent means “daemon predates the field”, never “module has no version” (the manifest field is required at registration).
The reading is ARMED BY OBSERVATION, not by this documentation: until a consumer has seen at least one populated entry from the daemon it is connected to, an all-None catalog is indistinguishable from an old daemon, and a client shipping the documented reading against it would hold a guarantee it does not have.
roles: Vec<ProviderRole>§control_ops: Vec<String>§capabilities: Option<CapabilityDeclarations>Static capability declarations from the registering module’s manifest.
Optional on the wire so consumers connected to a daemon that predates the capability grammar retain their existing catalog decoding behavior.
self_signals: Option<Vec<SelfSignalDeclaration>>Self-signal declarations mirrored verbatim from the registering module’s manifest. The daemon relays these declarations without interpreting them.
events: Option<Vec<EventDeclaration>>Event declarations mirrored verbatim from the registering module’s manifest.
Absent when the manifest omits events; an empty array records an affirmative
declaration that the module publishes no events.
operation_delivery: BTreeMap<String, OperationDelivery>Open delivery hints mirrored from the module manifest. Empty means unary;
only "watch" on a declared management query is subscribable.
operation_payload: BTreeMap<String, OperationPayload>Raw request payload limits mirrored from the module manifest by operation name. Empty maps preserve catalog bytes from before payload declarations.
flow_operations: Option<Vec<String>>Management operations the module serves to a flow-scoped call, mirrored unchanged from its manifest. Absent means the module did not say, so a reader treats the answer as unknown rather than as “none”; an empty list admits no operation under a flow scope. Absence preserves catalog bytes from before the field. The daemon relays it and never enforces it.
rich_ui: Option<RichUiDescriptor>Rich-UI descriptor mirrored verbatim from the registering manifest. The daemon does not fetch or interpret the manifest described here.
role_declarations: BTreeMap<String, Map<String, Value>>Opaque per-role objects mirrored unchanged from the registered manifest. Each role owns its schema; the daemon validates only keys, shape and size.
nonce_verified: boolTrue only when HELLO passes the launch-nonce check required for a reserved module or swap candidate.
Implementations§
Source§impl CatalogEntry
impl CatalogEntry
Sourcepub fn new(
module_id: impl Into<String>,
roles: Vec<ProviderRole>,
control_ops: Vec<String>,
) -> Self
pub fn new( module_id: impl Into<String>, roles: Vec<ProviderRole>, control_ops: Vec<String>, ) -> Self
Construct an entry with its required fields and wire-compatible defaults.
Sourcepub fn with_operation_payload(
self,
operation_payload: BTreeMap<String, OperationPayload>,
) -> Self
pub fn with_operation_payload( self, operation_payload: BTreeMap<String, OperationPayload>, ) -> Self
Set raw request payload limits mirrored from the registered manifest.
Sourcepub fn with_flow_operations(self, flow_operations: Option<Vec<String>>) -> Self
pub fn with_flow_operations(self, flow_operations: Option<Vec<String>>) -> Self
Set or clear the flow-scoped operation list mirrored from the registered
manifest. None is omitted from the wire.
Sourcepub fn with_ready(self, ready: bool) -> Self
pub fn with_ready(self, ready: bool) -> Self
Set the module’s effective readiness.
Sourcepub fn with_not_ready(self, not_ready: Option<NotReadyReason>) -> Self
pub fn with_not_ready(self, not_ready: Option<NotReadyReason>) -> Self
Set or clear the reason the module is not ready.
Sourcepub fn with_module_version(self, module_version: Option<String>) -> Self
pub fn with_module_version(self, module_version: Option<String>) -> Self
Set or clear the module’s self-declared version.
Sourcepub fn with_capabilities(
self,
capabilities: Option<CapabilityDeclarations>,
) -> Self
pub fn with_capabilities( self, capabilities: Option<CapabilityDeclarations>, ) -> Self
Set or clear the module’s static capability declarations.
Sourcepub fn with_self_signals(
self,
self_signals: Option<Vec<SelfSignalDeclaration>>,
) -> Self
pub fn with_self_signals( self, self_signals: Option<Vec<SelfSignalDeclaration>>, ) -> Self
Set or clear the module’s self-signal declarations.
Sourcepub fn with_events(self, events: Option<Vec<EventDeclaration>>) -> Self
pub fn with_events(self, events: Option<Vec<EventDeclaration>>) -> Self
Set or clear the event declarations mirrored from the module manifest.
Sourcepub fn with_operation_delivery(
self,
operation_delivery: BTreeMap<String, OperationDelivery>,
) -> Self
pub fn with_operation_delivery( self, operation_delivery: BTreeMap<String, OperationDelivery>, ) -> Self
Set delivery hints mirrored from the module manifest. Serialization omits this field when the stored map is empty.
Sourcepub fn with_rich_ui(self, rich_ui: Option<RichUiDescriptor>) -> Self
pub fn with_rich_ui(self, rich_ui: Option<RichUiDescriptor>) -> Self
Set the descriptor mirrored from the module’s HELLO manifest.
Sourcepub fn with_role_declarations(
self,
role_declarations: BTreeMap<String, Map<String, Value>>,
) -> Self
pub fn with_role_declarations( self, role_declarations: BTreeMap<String, Map<String, Value>>, ) -> Self
Set opaque per-role declarations mirrored from the registered manifest.
Sourcepub fn with_nonce_verified(self, nonce_verified: bool) -> Self
pub fn with_nonce_verified(self, nonce_verified: bool) -> Self
Mark a registration as nonce-verified when HELLO passes the launch-nonce check required for a reserved module or swap candidate.