Skip to main content

canic_core/dto/
component_deployment.rs

1//! Module: dto::component_deployment
2//!
3//! Responsibility: carry one runtime's immutable Component deployment context.
4//! Does not own: configuration compilation, context validation, persistence, or enforcement.
5//! Boundary: roots install this passive context and application policy reads the retained value.
6
7use crate::ids::{
8    ComponentBinding, ComponentDeploymentConfigurationDigest, ComponentGroupMemberPath,
9    ComponentGroupPlacementId, ComponentGroupSpecId,
10};
11use candid::CandidType;
12use serde::{Deserialize, Serialize};
13
14pub use crate::config::{
15    ComponentDeploymentLabel, ComponentDeploymentLabelKey, ComponentDeploymentLabelValue,
16    ComponentDeploymentLimits, ComponentDeploymentPurpose, ComponentDeploymentSpawnGrantLimit,
17    FleetServiceMemberPurpose,
18};
19
20///
21/// ProtectedComponentDeployment
22///
23/// Plan-derived deployment identity and policy retained by one managed Component-tree runtime.
24///
25
26#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
27#[serde(deny_unknown_fields)]
28#[expect(
29    clippy::large_enum_variant,
30    reason = "the bounded protected boundary intentionally preserves the design's direct field shape"
31)]
32pub enum ProtectedComponentDeployment {
33    UngroupedOrdinary {
34        binding: ComponentBinding,
35    },
36    GroupMember {
37        binding: ComponentBinding,
38        configuration_digest: ComponentDeploymentConfigurationDigest,
39        group_placement: ComponentGroupPlacementId,
40        component_group: ComponentGroupSpecId,
41        member_path: ComponentGroupMemberPath,
42        purpose: ComponentDeploymentPurpose,
43        labels: Vec<ComponentDeploymentLabel>,
44        limits: ComponentDeploymentLimits,
45    },
46}