Skip to main content

SagaResultEnvelope

Struct SagaResultEnvelope 

Source
pub struct SagaResultEnvelope {
Show 14 fields pub event_id: String, pub saga_id: String, pub tenant_id: String, pub workflow: String, pub definition_version: u32, pub definition_digest: String, pub step: String, pub phase: String, pub attempt: u32, pub effect_id: String, pub command_id: String, pub status: String, pub terminal_status: Option<String>, pub reason_code: Option<String>,
}
Expand description

业务作用:参与方发回 Orchestrator 的结果 envelope。

字段说明:status 是 attempt journal 词汇(四个 phase 终态的并集); terminal_status 仅在取消屏障裁决 ALREADY_TERMINAL 时携带正向真实终态。

Fields§

§event_id: String

结果事件身份,进入 Orchestrator Inbox 去重。

§saga_id: String

实例身份。

§tenant_id: String

规范化租户。

§workflow: String

workflow 名称。

§definition_version: u32

definition 版本。

§definition_digest: String

definition 摘要。

§step: String

步骤名称。

§phase: String

执行阶段稳定名。

§attempt: u32

尝试序号。

§effect_id: String

效果身份。

§command_id: String

命令身份。

§status: String

attempt 终态稳定名(SUCCEEDED/REJECTED/…/RESOLUTION_PENDING)。

§terminal_status: Option<String>

取消裁决 ALREADY_TERMINAL 携带的正向真实终态稳定名。

§reason_code: Option<String>

稳定原因码;禁止携带敏感明细。

Implementations§

Source§

impl SagaResultEnvelope

Source

pub fn verified(&self) -> Result<VerifiedIdentity>

业务作用:解析并复验结果 envelope 的身份字段。

参数说明: 无。

返回:复验通过返回已证身份;否则返回错误,调用方走隔离路径。

Source

pub fn parsed_status(&self) -> Result<StepAttemptStatus>

业务作用:解析结果状态列,收敛回 attempt journal 封闭词汇。

参数说明: 无。

返回:合法且非 STARTED 时返回状态;否则返回错误——结果必须是已裁决状态。

Source

pub fn parsed_terminal(&self) -> Result<Option<StepForwardStatus>>

业务作用:解析取消裁决携带的正向真实终态。

参数说明: 无。

返回:ALREADY_TERMINAL 结果返回其终态;其它结果返回 None;文本非法返回错误。

Source

pub fn to_outbox_event(&self) -> Result<OutboxEvent>

业务作用:把结果 envelope 序列化为 Outbox 事件(参与方侧使用)。

参数说明: 无。

返回:可交给 naoutbox 的事件;序列化失败返回错误。

Trait Implementations§

Source§

impl Clone for SagaResultEnvelope

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 SagaResultEnvelope

Source§

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

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

impl<'de> Deserialize<'de> for SagaResultEnvelope

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 SagaResultEnvelope

Source§

impl PartialEq for SagaResultEnvelope

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 SagaResultEnvelope

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 SagaResultEnvelope

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