pub struct DefinitionActivationGate { /* private fields */ }Expand description
业务作用:冻结一次 definition 激活必须满足的集群快照与数据面路由合同。
Implementations§
Source§impl DefinitionActivationGate
impl DefinitionActivationGate
Sourcepub fn new(
orchestrator_service_identity: ServiceIdentity,
catalog_generation: u64,
snapshot_digest: impl Into<String>,
transport: impl Into<String>,
) -> Result<Self>
pub fn new( orchestrator_service_identity: ServiceIdentity, catalog_generation: u64, snapshot_digest: impl Into<String>, transport: impl Into<String>, ) -> Result<Self>
业务作用:构造只能由同代 Ready 副本和指定数据面共同满足的激活门禁。
参数说明:orchestrator_service_identity 定位逻辑控制面,catalog_generation 与
snapshot_digest 固定副本已确认快照,transport 固定本次部署的数据面协议。
返回:摘要和协议属于封闭集合时返回门禁;无效输入拒绝进入数据库激活事务。
Sourcepub fn with_redis_key_tag(self, key_tag: impl Into<String>) -> Result<Self>
pub fn with_redis_key_tag(self, key_tag: impl Into<String>) -> Result<Self>
业务作用:把 Redis Cluster 的实际同槽配置绑定进 definition 激活门禁,确保数据库裁决 与稍后构造 publisher 使用同一份 route 上下文。
参数说明:key_tag 是运行配置要求 capability stream 首个生效 hash tag 匹配的值。
返回:仅在 transport 为 Redis Streams 且 tag 满足名称合同时返回门禁;其它组合返回错误。
Sourcepub fn with_address_policy_digest(
self,
digest: impl Into<String>,
) -> Result<Self>
pub fn with_address_policy_digest( self, digest: impl Into<String>, ) -> Result<Self>
业务作用:把当前 transport 的受信地址政策绑定进副本确认与 definition 激活门禁。
参数说明:digest 是调用方对 transport 专属 canonical allowlist 计算的 SHA-256。
返回:摘要合法时返回更新后的门禁;格式无效时拒绝形成可持久确认的运行时合同。
Sourcepub fn with_publisher_contract_digest(
self,
digest: impl Into<String>,
) -> Result<Self>
pub fn with_publisher_contract_digest( self, digest: impl Into<String>, ) -> Result<Self>
业务作用:把最终 publisher 使用的路由、凭据、client 与超时合同绑定进副本确认, 防止同一 Catalog 快照被运行参数不同的副本同时发布为权威。
参数说明:digest 是调用方对已解析 publisher 输入计算的 canonical SHA-256。
返回:摘要格式合法时返回更新后的门禁;格式无效时拒绝形成持久确认。
Sourcepub fn with_result_backend_digest(
self,
digest: impl Into<String>,
) -> Result<Self>
pub fn with_result_backend_digest( self, digest: impl Into<String>, ) -> Result<Self>
业务作用:把 Kafka result 返回路径的后端身份绑定进激活事务,确保参与方能力与 Orchestrator consumer 使用同一套 broker 命名边界。
参数说明:digest 是规范化 broker 地址集合与 result topic 前缀形成的 SHA-256。
返回:仅在 transport 为 Kafka 且摘要格式合法时返回门禁;其它组合拒绝激活。
Sourcepub fn with_result_contract_digest(
self,
owner: impl Into<String>,
digest: impl Into<String>,
) -> Result<Self>
pub fn with_result_contract_digest( self, owner: impl Into<String>, digest: impl Into<String>, ) -> Result<Self>
业务作用:把一个 participant owner 的 result 发送凭据与 Orchestrator 接收凭据绑定进激活事务。
参数说明:owner 是 definition step 的服务身份,digest 是协议专属凭据合同的 SHA-256。
返回:身份与摘要合法时返回门禁;非法输入拒绝形成副本确认合同。
Sourcepub fn orchestrator_service_identity(&self) -> &ServiceIdentity
pub fn orchestrator_service_identity(&self) -> &ServiceIdentity
业务作用:返回有权确认本次激活快照的逻辑 Orchestrator 身份。
参数说明: 无。
返回:构造门禁时已校验的长期服务身份。
Sourcepub fn catalog_generation(&self) -> u64
pub fn catalog_generation(&self) -> u64
业务作用:返回待激活 definition 所依赖的精确 Catalog generation。
参数说明: 无。
返回:副本确认和数据库状态必须共同命中的代际。
Sourcepub fn snapshot_digest(&self) -> &str
pub fn snapshot_digest(&self) -> &str
业务作用:返回全部有效 Ready 副本必须一致确认的完整快照摘要。
参数说明: 无。
返回:六十四位十六进制摘要。
Sourcepub fn transport(&self) -> &str
pub fn transport(&self) -> &str
业务作用:返回 definition 每个步骤在激活时必须具备的受管数据面协议。
参数说明: 无。
返回:HTTP、gRPC、Kafka 或 Redis Streams 的稳定协议名。
Sourcepub fn redis_key_tag(&self) -> Option<&str>
pub fn redis_key_tag(&self) -> Option<&str>
业务作用:返回 Redis Streams 激活时必须由 capability route 满足的 Cluster 同槽 tag。
参数说明: 无。
返回:Redis 激活门禁绑定的 tag;其它 transport 或尚未补齐上下文时为空。
Sourcepub fn result_backend_digest(&self) -> Option<&str>
pub fn result_backend_digest(&self) -> Option<&str>
业务作用:返回 Kafka candidate 必须匹配的 result broker 与 topic 命名合同摘要。
参数说明: 无。
返回:Kafka 激活门禁已绑定的摘要;其它 transport 返回空。
Sourcepub fn accepts_result_contract(&self, owner: &str, digest: &str) -> bool
pub fn accepts_result_contract(&self, owner: &str, digest: &str) -> bool
业务作用:判断 capability 声明的 result 凭据合同是否属于该 owner 的受信接收集合。
参数说明:owner 是步骤服务身份,digest 是 participant 发布的协议专属合同摘要。
返回:门禁中存在完全一致的 owner 与摘要时为真。
Sourcepub fn activation_contract_digest(&self) -> &str
pub fn activation_contract_digest(&self) -> &str
业务作用:返回全部 Ready 副本必须一致确认的数据面与地址政策摘要。
参数说明: 无。
返回:绑定 transport、Redis tag、地址政策和最终 publisher 输入的 canonical SHA-256。