pub enum LambdaBody {
Instruction(Arc<VMInstructionPackage>),
NativeFunction((Arc<dyn Fn(&OnionObject, &OnionFastMap<Box<str>, OnionStaticObject>, &OnionFastMap<Box<str>, OnionObject>, &mut GC<OnionObjectCell>) -> Box<dyn Runnable> + Send + Sync>, OnionKeyPool<Box<str>>)),
}
Expand description
Lambda 体类型。
支持字节码(Instruction)和原生函数(NativeFunction)。
Variants§
Instruction(Arc<VMInstructionPackage>)
字节码实现
NativeFunction((Arc<dyn Fn(&OnionObject, &OnionFastMap<Box<str>, OnionStaticObject>, &OnionFastMap<Box<str>, OnionObject>, &mut GC<OnionObjectCell>) -> Box<dyn Runnable> + Send + Sync>, OnionKeyPool<Box<str>>))
原生函数实现(带字符串池),用于启动一个 Runnable
Trait Implementations§
Source§impl Clone for LambdaBody
impl Clone for LambdaBody
Source§impl Debug for LambdaBody
impl Debug for LambdaBody
Auto Trait Implementations§
impl Freeze for LambdaBody
impl !RefUnwindSafe for LambdaBody
impl Send for LambdaBody
impl Sync for LambdaBody
impl Unpin for LambdaBody
impl !UnwindSafe for LambdaBody
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