Skip to main content

CapabilityDescriptor

Struct CapabilityDescriptor 

Source
pub struct CapabilityDescriptor {
Show 17 fields pub payload_contract: Option<SagaPayloadContract>, pub tenant: String, pub owner: String, pub replica_identity: String, pub workflow: String, pub definition_version: u32, pub step: String, pub compensation: DefinitionCompensation, pub cancel_mode: DefinitionCancelMode, pub allow_unknown: bool, pub resolution_mode: Option<DefinitionResolutionMode>, pub transport: String, pub endpoint: String, pub effective_saga_base_path: Option<String>, pub result_contract_digest: Option<String>, pub route_generation: u64, pub requested_lease_ms: u64,
}
Expand description

业务作用:声明参与方当前可执行步骤的协议和逐实例地址事实。

Fields§

§payload_contract: Option<SagaPayloadContract>

本 handler 接受的正文合同,必须与 definition 中对应步骤一致。

§tenant: String

能力获准服务的租户,必须与 definition key 和授权范围一致。

§owner: String

能力所属逻辑服务身份,必须与认证主体一致。

§replica_identity: String

当前副本的稳定身份,用于租约续租。

§workflow: String

支持的 workflow。

§definition_version: u32

支持的 definition 版本。

§step: String

支持的步骤名称。

§compensation: DefinitionCompensation

步骤补偿能力。

§cancel_mode: DefinitionCancelMode

步骤取消形态。

§allow_unknown: bool

是否托管未知结果解决入口。

§resolution_mode: Option<DefinitionResolutionMode>

托管的解决模式;禁止未知时为空。

§transport: String

command transport 的稳定名称。

§endpoint: String

当前实例 origin 或 broker route,不包含凭据。

§effective_saga_base_path: Option<String>

HTTP 模式下实际生效的 Saga 基础路径。

§result_contract_digest: Option<String>

result producer 与 Orchestrator 接收端共同持有的协议专属凭据或后端合同摘要。

§route_generation: u64

endpoint 与路径绑定的单调 route generation;持久值由 Catalog 在主键行锁内分配。

§requested_lease_ms: u64

客户端建议的租约时长;服务端执行有界裁剪。

Implementations§

Source§

impl CapabilityDescriptor

Source

pub fn digest(&self) -> String

业务作用:计算不受续租建议影响的 capability 内容摘要,供幂等续租与 route 变更检测。

参数说明: 无。

返回:覆盖 owner、步骤合同、transport、endpoint 与 route generation 的小写十六进制摘要。

Source

pub fn route_contract_digest(&self) -> String

业务作用:计算不含租约建议和已分配代际的路由合同摘要,供 Catalog 判断真实内容是否变化。

参数说明: 无。

返回:覆盖身份、步骤语义、transport、endpoint 与有效路径的稳定小写十六进制摘要。

Source

pub fn matches_step( &self, tenant: &str, definition: &WorkflowDefinition, step: &StepDefinition, ) -> bool

业务作用:复验 capability 与 definition 中被引用步骤的不可变语义一致。

参数说明:tenant 是候选流程的授权租户,definition 是候选流程,step 是其中一个步骤。

返回:owner、步骤身份、版本与能力完全一致时为真。

Trait Implementations§

Source§

impl Clone for CapabilityDescriptor

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 CapabilityDescriptor

Source§

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

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

impl<'de> Deserialize<'de> for CapabilityDescriptor

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for CapabilityDescriptor

Source§

impl PartialEq for CapabilityDescriptor

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 Serialize for CapabilityDescriptor

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CapabilityDescriptor

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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