pub fn into_sync(self) -> Result<SyncFunction, VmError> {
        let inner = match self.inner {
            Inner::FnClosureOffset(closure) => {
                let mut env = Vec::with_capacity(closure.environment.len());

                for value in closure.environment.into_vec() {
                    env.push(FromValue::from_value(value)?);
                }

                Inner::FnClosureOffset(FnClosureOffset {
                    fn_offset: closure.fn_offset,
                    environment: env.into_boxed_slice(),
                })
            }
            Inner::FnHandler(inner) => Inner::FnHandler(inner),
            Inner::FnOffset(inner) => Inner::FnOffset(inner),
            Inner::FnUnitStruct(inner) => Inner::FnUnitStruct(inner),
            Inner::FnTupleStruct(inner) => Inner::FnTupleStruct(inner),
            Inner::FnUnitVariant(inner) => Inner::FnUnitVariant(inner),
            Inner::FnTupleVariant(inner) => Inner::FnTupleVariant(inner),
        };

        Ok(SyncFunction { inner })
    }
/// Try to convert into a [SyncFunction].
Try to convert into a [SyncFunction].
Try to convert into a [ SyncFunction ] .
pub fn into_sync(self) -> Result<SyncFunction, VmError> {
        let inner = match self.inner {
            Inner::FnClosureOffset(closure) => {
                let mut env = Vec::with_capacity(closure.environment.len());
                for value in closure.environment.into_vec() {
                    env.push(FromValue::from_value(value)?);
                }
                Inner::FnClosureOffset(FnClosureOffset {
                    fn_offset: closure.fn_offset,
                    environment: env.into_boxed_slice(),
                })
            }
            Inner::FnHandler(inner) => Inner::FnHandler(inner),
            Inner::FnOffset(inner) => Inner::FnOffset(inner),
            Inner::FnUnitStruct(inner) => Inner::FnUnitStruct(inner),
            Inner::FnTupleStruct(inner) => Inner::FnTupleStruct(inner),
            Inner::FnUnitVariant(inner) => Inner::FnUnitVariant(inner),
            Inner::FnTupleVariant(inner) => Inner::FnTupleVariant(inner),
        };
        Ok(SyncFunction { inner })
    }
pub fn into_sync ( self ) -> Result < SyncFunction , VmError > { let inner = match self . inner { Inner :: FnClosureOffset ( closure ) => { let mut env = Vec :: with_capacity ( closure . environment . len ( ) ) ; for value in closure . environment . into_vec ( ) { env . push ( FromValue :: from_value ( value ) ? ) ; } Inner :: FnClosureOffset ( FnClosureOffset { fn_offset : closure . fn_offset , environment : env . into_boxed_slice ( ) , } ) } Inner :: FnHandler ( inner ) => Inner :: FnHandler ( inner ) , Inner :: FnOffset ( inner ) => Inner :: FnOffset ( inner ) , Inner :: FnUnitStruct ( inner ) => Inner :: FnUnitStruct ( inner ) , Inner :: FnTupleStruct ( inner ) => Inner :: FnTupleStruct ( inner ) , Inner :: FnUnitVariant ( inner ) => Inner :: FnUnitVariant ( inner ) , Inner :: FnTupleVariant ( inner ) => Inner :: FnTupleVariant ( inner ) , } ; Ok ( SyncFunction { inner } ) }
Try to convert into a [SyncFunction].
Try to convert into a [ SyncFunction ] .
self
self