pub struct AuditRecord {Show 13 fields
pub coord: ActionCoord,
pub intent_id: String,
pub action_type: ActionType,
pub target: Option<String>,
pub effect: EffectClass,
pub route: DecisionRoute,
pub backend_error: Option<String>,
pub transitions: Vec<ActionState>,
pub terminal: ActionState,
pub outcome: Option<ActionOutcomeSummary>,
pub denial_reason: Option<DenialReason>,
pub error: Option<String>,
pub source_tier: SourceTier,
}Expand description
审计记录。
每个 ActionProposal(即每个 ActionCoord)在生命周期中产出恰好一条。
Fields§
§coord: ActionCoord确定性主键,进 canonical hash。
intent_id: String运行时关联(含 UUID),volatile,不进 canonical hash。
action_type: ActionType§target: Option<String>§effect: EffectClass§route: DecisionRoute产生该动作的后端路由,确定性,进 canonical hash。
backend_error: Option<String>后端失败/熔断等诊断信息,volatile,不进 canonical hash。
transitions: Vec<ActionState>完整迁移序列。
terminal: ActionState终态(冗余但便于查询/golden)。
outcome: Option<ActionOutcomeSummary>成功时写入 adapter outcome 的确定性摘要,进 canonical hash。
denial_reason: Option<DenialReason>拒绝原因(终态为拒绝时)。
error: Option<String>错误信息(终态为 Failed 时)。
source_tier: SourceTierSource tier of the window that produced this action proposal. Deterministic, included in canonical hash.
Implementations§
Source§impl AuditRecord
impl AuditRecord
Sourcepub fn new(
proposal: &ActionProposal,
route: DecisionRoute,
source_tier: SourceTier,
) -> Self
pub fn new( proposal: &ActionProposal, route: DecisionRoute, source_tier: SourceTier, ) -> Self
从初态 Proposed 开始构建一条审计记录。
Sourcepub fn transition(&mut self, state: ActionState)
pub fn transition(&mut self, state: ActionState)
追加一个状态迁移,并更新 terminal。
Trait Implementations§
Source§impl Clone for AuditRecord
impl Clone for AuditRecord
Source§fn clone(&self) -> AuditRecord
fn clone(&self) -> AuditRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuditRecord
impl Debug for AuditRecord
Source§impl<'de> Deserialize<'de> for AuditRecord
impl<'de> Deserialize<'de> for AuditRecord
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
Auto Trait Implementations§
impl Freeze for AuditRecord
impl RefUnwindSafe for AuditRecord
impl Send for AuditRecord
impl Sync for AuditRecord
impl Unpin for AuditRecord
impl UnsafeUnpin for AuditRecord
impl UnwindSafe for AuditRecord
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