Skip to main content

DefinitionActivationGate

Struct DefinitionActivationGate 

Source
pub struct DefinitionActivationGate { /* private fields */ }
Expand description

业务作用:冻结一次 definition 激活必须满足的集群快照与数据面路由合同。

Implementations§

Source§

impl DefinitionActivationGate

Source

pub fn new( orchestrator_service_identity: ServiceIdentity, catalog_generation: u64, snapshot_digest: impl Into<String>, transport: impl Into<String>, ) -> Result<Self>

业务作用:构造关联控制服务、目录快照和数据面协议的定义激活门禁。

参数说明:

  • orchestrator_service_identity:需要确认同代快照的逻辑编排服务身份。
  • catalog_generation:期望副本确认的共享目录代际,构造时原样保存。
  • snapshot_digest:需要副本确认的 64 位十六进制快照摘要。
  • transport:只允许 http、grpc、kafka 或 redis-stream 的数据面协议。

返回:摘要及协议有效时返回已计算激活合同摘要的门禁;非法时返回错误。可选数据面约束初始为空,不在此核实副本 Ready 或数据库事实。

Source

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 满足名称合同时返回门禁;其它组合返回错误。

Source

pub fn with_address_policy_digest( self, digest: impl Into<String>, ) -> Result<Self>

业务作用:把当前 transport 的受信地址政策绑定进副本确认与 definition 激活门禁。

参数说明:

  • digest:是调用方对 transport 专属 canonical allowlist 计算的 SHA-256。

返回:摘要合法时返回更新后的门禁;格式无效时拒绝形成可持久确认的运行时合同。

Source

pub fn with_publisher_contract_digest( self, digest: impl Into<String>, ) -> Result<Self>

业务作用:把最终 publisher 使用的路由、凭据、client 与超时合同绑定进副本确认, 防止同一 Catalog 快照被运行参数不同的副本同时发布为权威。

参数说明:

  • digest:是调用方对已解析 publisher 输入计算的 canonical SHA-256。

返回:摘要格式合法时返回更新后的门禁;格式无效时拒绝形成持久确认。

Source

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 且摘要格式合法时返回门禁;其它组合拒绝激活。

Source

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。

返回:身份与摘要合法时返回门禁;非法输入拒绝形成副本确认合同。

Source

pub fn orchestrator_service_identity(&self) -> &ServiceIdentity

业务作用:返回有权确认本次激活快照的逻辑 Orchestrator 身份。

参数说明: 无。

返回:构造门禁时已校验的长期服务身份。

Source

pub fn catalog_generation(&self) -> u64

业务作用:返回待激活 definition 所依赖的精确 Catalog generation。

参数说明: 无。

返回:副本确认和数据库状态必须共同命中的代际。

Source

pub fn snapshot_digest(&self) -> &str

业务作用:返回全部有效 Ready 副本必须一致确认的完整快照摘要。

参数说明: 无。

返回:六十四位十六进制摘要。

Source

pub fn transport(&self) -> &str

业务作用:返回 definition 每个步骤在激活时必须具备的受管数据面协议。

参数说明: 无。

返回:HTTP、gRPC、Kafka 或 Redis Streams 的稳定协议名。

Source

pub fn redis_key_tag(&self) -> Option<&str>

业务作用:返回 Redis Streams 激活时必须由 capability route 满足的 Cluster 同槽 tag。

参数说明: 无。

返回:Redis 激活门禁绑定的 tag;其它 transport 或尚未补齐上下文时为空。

Source

pub fn result_backend_digest(&self) -> Option<&str>

业务作用:返回 Kafka candidate 必须匹配的 result broker 与 topic 命名合同摘要。

参数说明: 无。

返回:Kafka 激活门禁已绑定的摘要;其它 transport 返回空。

Source

pub fn accepts_result_contract(&self, owner: &str, digest: &str) -> bool

业务作用:判断 capability 声明的 result 凭据合同是否属于该 owner 的受信接收集合。

参数说明:

  • owner:是步骤服务身份
  • digest:是 participant 发布的协议专属合同摘要。

返回:门禁中存在完全一致的 owner 与摘要时为真。

Source

pub fn activation_contract_digest(&self) -> &str

业务作用:返回全部 Ready 副本必须一致确认的数据面与地址政策摘要。

参数说明: 无。

返回:绑定 transport、Redis tag、地址政策和最终 publisher 输入的 canonical SHA-256。

Trait Implementations§

Source§

impl Clone for DefinitionActivationGate

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DefinitionActivationGate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DefinitionActivationGate

Source§

impl PartialEq for DefinitionActivationGate

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DefinitionActivationGate

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more