pub struct ActionLifecycle<'a> { /* private fields */ }Expand description
Action Bus 治理状态机。
内部持有 PolicyEngine 与 ActionAdapter,是 AuthorizedAction 的唯一构造点。
Implementations§
Source§impl<'a> ActionLifecycle<'a>
impl<'a> ActionLifecycle<'a>
pub fn new(policy: &'a PolicyEngine, adapter: &'a dyn ActionAdapter) -> Self
Sourcepub fn policy(&self) -> &'a PolicyEngine
pub fn policy(&self) -> &'a PolicyEngine
暴露内部持有的 PolicyEngine,供调用方在 Policy-only 阶段直接做策略裁决。
Sourcepub fn run(
&self,
window_ordinal: u32,
batch: &IntentBatch,
route: DecisionRoute,
backend_error: Option<String>,
capability: &CapabilityLevel,
ctx: &StructuredContext,
) -> Vec<AuditRecord>
pub fn run( &self, window_ordinal: u32, batch: &IntentBatch, route: DecisionRoute, backend_error: Option<String>, capability: &CapabilityLevel, ctx: &StructuredContext, ) -> Vec<AuditRecord>
处理一个窗口的意图批次,返回每条动作恰好一条终态审计记录。
window_ordinal 由调用方(replay/daemon 驱动循环)显式传入,保证状态机
本身无隐藏可变状态,且 replay 间坐标稳定。
Auto Trait Implementations§
impl<'a> Freeze for ActionLifecycle<'a>
impl<'a> !RefUnwindSafe for ActionLifecycle<'a>
impl<'a> !Send for ActionLifecycle<'a>
impl<'a> !Sync for ActionLifecycle<'a>
impl<'a> Unpin for ActionLifecycle<'a>
impl<'a> UnsafeUnpin for ActionLifecycle<'a>
impl<'a> !UnwindSafe for ActionLifecycle<'a>
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