pub struct OnionLambdaRunnableLauncher { /* private fields */ }Implementations§
Source§impl OnionLambdaRunnableLauncher
impl OnionLambdaRunnableLauncher
pub fn new_static<F>( lambda_obj: &OnionStaticObject, argument_tuple_obj: &OnionStaticObject, runnable_mapper: &'static F, ) -> Result<OnionLambdaRunnableLauncher, RuntimeError>
Trait Implementations§
Source§impl Runnable for OnionLambdaRunnableLauncher
impl Runnable for OnionLambdaRunnableLauncher
Source§fn step(&mut self, gc: &mut GC<OnionObjectCell>) -> StepResult
fn step(&mut self, gc: &mut GC<OnionObjectCell>) -> StepResult
执行 Lambda 启动器的下一步操作。
此方法通过一个状态机来处理参数的收集、验证(通过约束)并最终启动 Lambda。 它的主要职责是:
- 如果存在参数约束 (
constrain_runnable),则先执行约束。 - 根据当前的
phase(命名参数、位置参数、完成)处理传入的参数。 - 收集和整理参数,直到所有参数处理完毕。
- 创建并返回目标 Lambda 的可运行实例。
§参数
gc: 垃圾收集器的可变引用,用于内存管理。
§返回
Ok(StepResult): 表示操作成功,并指示调度器下一步应该做什么。StepResult::Continue: 表示启动器需要更多步骤来完成参数处理或约束执行。StepResult::ReplaceRunnable: 表示参数处理完成,启动器应被新的 Lambda 可运行实例替换。
Err(RuntimeError): 表示在执行过程中发生错误。
fn copy(&self) -> Box<dyn Runnable>
fn receive( &mut self, step_result: &StepResult, _gc: &mut GC<OnionObjectCell>, ) -> Result<(), RuntimeError>
fn format_context(&self) -> Result<Value, RuntimeError>
fn copy_with_gc(&self, gc: &mut GC<OnionObjectCell>) -> Box<dyn Runnable>
Auto Trait Implementations§
impl Freeze for OnionLambdaRunnableLauncher
impl !RefUnwindSafe for OnionLambdaRunnableLauncher
impl Send for OnionLambdaRunnableLauncher
impl Sync for OnionLambdaRunnableLauncher
impl Unpin for OnionLambdaRunnableLauncher
impl !UnwindSafe for OnionLambdaRunnableLauncher
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