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: Stringworkflow 名称。
definition_version: u32definition 版本。
definition_digest: Stringdefinition 摘要。
step: String步骤名称。
phase: String执行阶段稳定名。
attempt: u32尝试序号。
effect_id: String效果身份。
command_id: String命令身份。
status: Stringattempt 终态稳定名(SUCCEEDED/REJECTED/…/RESOLUTION_PENDING)。
terminal_status: Option<String>取消裁决 ALREADY_TERMINAL 携带的正向真实终态稳定名。
reason_code: Option<String>稳定原因码;禁止携带敏感明细。
Implementations§
Source§impl SagaResultEnvelope
impl SagaResultEnvelope
Sourcepub fn verified(&self) -> Result<VerifiedIdentity>
pub fn verified(&self) -> Result<VerifiedIdentity>
业务作用:解析并复验结果 envelope 的身份字段。
参数说明: 无。
返回:复验通过返回已证身份;否则返回错误,调用方走隔离路径。
Sourcepub fn parsed_status(&self) -> Result<StepAttemptStatus>
pub fn parsed_status(&self) -> Result<StepAttemptStatus>
业务作用:解析结果状态列,收敛回 attempt journal 封闭词汇。
参数说明: 无。
返回:合法且非 STARTED 时返回状态;否则返回错误——结果必须是已裁决状态。
Sourcepub fn parsed_terminal(&self) -> Result<Option<StepForwardStatus>>
pub fn parsed_terminal(&self) -> Result<Option<StepForwardStatus>>
业务作用:解析取消裁决携带的正向真实终态。
参数说明: 无。
返回:ALREADY_TERMINAL 结果返回其终态;其它结果返回 None;文本非法返回错误。
Sourcepub fn to_outbox_event(&self) -> Result<OutboxEvent>
pub fn to_outbox_event(&self) -> Result<OutboxEvent>
业务作用:把结果 envelope 序列化为 Outbox 事件(参与方侧使用)。
参数说明: 无。
返回:可交给 naoutbox 的事件;序列化失败返回错误。
Trait Implementations§
Source§impl Clone for SagaResultEnvelope
impl Clone for SagaResultEnvelope
Source§impl Debug for SagaResultEnvelope
impl Debug for SagaResultEnvelope
Source§impl<'de> Deserialize<'de> for SagaResultEnvelope
impl<'de> Deserialize<'de> for SagaResultEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SagaResultEnvelope
Source§impl PartialEq for SagaResultEnvelope
impl PartialEq for SagaResultEnvelope
Source§impl Serialize for SagaResultEnvelope
impl Serialize for SagaResultEnvelope
impl StructuralPartialEq for SagaResultEnvelope
Auto Trait Implementations§
impl Forget for SagaResultEnvelope
impl Freeze for SagaResultEnvelope
impl Move for SagaResultEnvelope
impl RefUnwindSafe for SagaResultEnvelope
impl Send for SagaResultEnvelope
impl Sync for SagaResultEnvelope
impl Unpin for SagaResultEnvelope
impl UnsafeUnpin for SagaResultEnvelope
impl UnwindSafe for SagaResultEnvelope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more