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#[cfg_attr(
29    target_pointer_width = "64",
30    expect(
31        clippy::large_enum_variant,
32        reason = "the bounded protected boundary intentionally preserves the design's direct field shape"
33    )
34)]
35pub enum ProtectedComponentDeployment {
36    UngroupedOrdinary {
37        binding: ComponentBinding,
38    },
39    GroupMember {
40        binding: ComponentBinding,
41        configuration_digest: ComponentDeploymentConfigurationDigest,
42        group_placement: ComponentGroupPlacementId,
43        component_group: ComponentGroupSpecId,
44        member_path: ComponentGroupMemberPath,
45        purpose: ComponentDeploymentPurpose,
46        labels: Vec<ComponentDeploymentLabel>,
47        limits: ComponentDeploymentLimits,
48    },
49}