Skip to main content

AuditRecord

Struct AuditRecord 

Source
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: SourceTier

Source tier of the window that produced this action proposal. Deterministic, included in canonical hash.

Implementations§

Source§

impl AuditRecord

Source

pub fn new( proposal: &ActionProposal, route: DecisionRoute, source_tier: SourceTier, ) -> Self

从初态 Proposed 开始构建一条审计记录。

Source

pub fn transition(&mut self, state: ActionState)

追加一个状态迁移,并更新 terminal。

Trait Implementations§

Source§

impl Clone for AuditRecord

Source§

fn clone(&self) -> AuditRecord

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AuditRecord

Source§

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

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

impl<'de> Deserialize<'de> for AuditRecord

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

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

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<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, 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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