pub struct ExecutionShell { /* private fields */ }Expand description
Implementations§
Source§impl ExecutionShell
impl ExecutionShell
pub fn new() -> Self
Sourcepub fn start(&mut self) -> Result<&[Effect], CoreError>
pub fn start(&mut self) -> Result<&[Effect], CoreError>
启动所有已注册模块(调用 on_start),返回初始 Effect 列表。
driver 在创建完 ExecutionShell 并注册所有模块后调用一次。
§BLK-1a 修复
逐模块调用 on_start 并立即 register_effects_to_maps(idx),
确保每个模块的 Correlation/TimerId 注册到正确的 module_index。
Sourcepub fn step(&mut self, tick: Tick, now_ms: u64) -> Result<&[Effect], CoreError>
pub fn step(&mut self, tick: Tick, now_ms: u64) -> Result<&[Effect], CoreError>
核心方法:处理一个 Tick,返回本次 step 产出的 Effect 切片。
§返回值生命周期
返回 &[Effect] 借用 self.scratch,在下一次 step() 调用前有效。
driver 必须在下一次 step() 之前消费完(或 clone)这些 Effect。
§路由策略
Inbound/Command:线性扫描accepts()PortReply:corr_map O(1) 定向投递并消费PortProgress:corr_map O(1) 定向投递但不消费Timer:timer_map O(1) 定向投递
§BLK-1a 修复
dispatch_inbound 返回的 Some(idx) 现在被正确传入 register_effects_to_maps,
替换了原来的 let module_index = 0usize; // placeholder 占位符。
这确保多模块场景中,Correlation/TimerId 被注册到正确的 module_index,
而不是错误地路由到 module[0]。
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ExecutionShell
impl !Sync for ExecutionShell
impl !UnwindSafe for ExecutionShell
impl Freeze for ExecutionShell
impl Send for ExecutionShell
impl Unpin for ExecutionShell
impl UnsafeUnpin for ExecutionShell
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