pub fn type_info(&self) -> Result<TypeInfo, VmError> {
        Ok(match self {
            Self::Unit => TypeInfo::StaticType(crate::UNIT_TYPE),
            Self::Bool(..) => TypeInfo::StaticType(crate::BOOL_TYPE),
            Self::Byte(..) => TypeInfo::StaticType(crate::BYTE_TYPE),
            Self::Char(..) => TypeInfo::StaticType(crate::CHAR_TYPE),
            Self::Integer(..) => TypeInfo::StaticType(crate::INTEGER_TYPE),
            Self::Float(..) => TypeInfo::StaticType(crate::FLOAT_TYPE),
            Self::StaticString(..) => TypeInfo::StaticType(crate::STRING_TYPE),
            Self::String(..) => TypeInfo::StaticType(crate::STRING_TYPE),
            Self::Bytes(..) => TypeInfo::StaticType(crate::BYTES_TYPE),
            Self::Vec(..) => TypeInfo::StaticType(crate::VEC_TYPE),
            Self::Tuple(..) => TypeInfo::StaticType(crate::TUPLE_TYPE),
            Self::Object(..) => TypeInfo::StaticType(crate::OBJECT_TYPE),
            Self::Range(..) => TypeInfo::StaticType(crate::RANGE_TYPE),
            Self::Future(..) => TypeInfo::StaticType(crate::FUTURE_TYPE),
            Self::Stream(..) => TypeInfo::StaticType(crate::STREAM_TYPE),
            Self::Generator(..) => TypeInfo::StaticType(crate::GENERATOR_TYPE),
            Self::GeneratorState(..) => TypeInfo::StaticType(crate::GENERATOR_STATE_TYPE),
            Self::Option(..) => TypeInfo::StaticType(crate::OPTION_TYPE),
            Self::Result(..) => TypeInfo::StaticType(crate::RESULT_TYPE),
            Self::Function(..) => TypeInfo::StaticType(crate::FUNCTION_TYPE),
            Self::Format(..) => TypeInfo::StaticType(crate::FORMAT_TYPE),
            Self::Iterator(..) => TypeInfo::StaticType(crate::ITERATOR_TYPE),
            Self::Type(..) => TypeInfo::StaticType(crate::TYPE),
            Self::UnitStruct(empty) => empty.borrow_ref()?.type_info(),
            Self::TupleStruct(tuple) => tuple.borrow_ref()?.type_info(),
            Self::Struct(object) => object.borrow_ref()?.type_info(),
            Self::Variant(empty) => empty.borrow_ref()?.type_info(),
            Self::Any(any) => TypeInfo::Any(any.borrow_ref()?.type_name()),
        })
    }
/// Get the type information for the current value.
Get the type information for the current value.
Get the type information for the current value .
pub fn type_info(&self) -> Result<TypeInfo, VmError> {
        Ok(match self {
            Self::Unit => TypeInfo::StaticType(crate::UNIT_TYPE),
            Self::Bool(..) => TypeInfo::StaticType(crate::BOOL_TYPE),
            Self::Byte(..) => TypeInfo::StaticType(crate::BYTE_TYPE),
            Self::Char(..) => TypeInfo::StaticType(crate::CHAR_TYPE),
            Self::Integer(..) => TypeInfo::StaticType(crate::INTEGER_TYPE),
            Self::Float(..) => TypeInfo::StaticType(crate::FLOAT_TYPE),
            Self::StaticString(..) => TypeInfo::StaticType(crate::STRING_TYPE),
            Self::String(..) => TypeInfo::StaticType(crate::STRING_TYPE),
            Self::Bytes(..) => TypeInfo::StaticType(crate::BYTES_TYPE),
            Self::Vec(..) => TypeInfo::StaticType(crate::VEC_TYPE),
            Self::Tuple(..) => TypeInfo::StaticType(crate::TUPLE_TYPE),
            Self::Object(..) => TypeInfo::StaticType(crate::OBJECT_TYPE),
            Self::Range(..) => TypeInfo::StaticType(crate::RANGE_TYPE),
            Self::Future(..) => TypeInfo::StaticType(crate::FUTURE_TYPE),
            Self::Stream(..) => TypeInfo::StaticType(crate::STREAM_TYPE),
            Self::Generator(..) => TypeInfo::StaticType(crate::GENERATOR_TYPE),
            Self::GeneratorState(..) => TypeInfo::StaticType(crate::GENERATOR_STATE_TYPE),
            Self::Option(..) => TypeInfo::StaticType(crate::OPTION_TYPE),
            Self::Result(..) => TypeInfo::StaticType(crate::RESULT_TYPE),
            Self::Function(..) => TypeInfo::StaticType(crate::FUNCTION_TYPE),
            Self::Format(..) => TypeInfo::StaticType(crate::FORMAT_TYPE),
            Self::Iterator(..) => TypeInfo::StaticType(crate::ITERATOR_TYPE),
            Self::Type(..) => TypeInfo::StaticType(crate::TYPE),
            Self::UnitStruct(empty) => empty.borrow_ref()?.type_info(),
            Self::TupleStruct(tuple) => tuple.borrow_ref()?.type_info(),
            Self::Struct(object) => object.borrow_ref()?.type_info(),
            Self::Variant(empty) => empty.borrow_ref()?.type_info(),
            Self::Any(any) => TypeInfo::Any(any.borrow_ref()?.type_name()),
        })
    }
pub fn type_info ( & self ) -> Result < TypeInfo , VmError > { Ok ( match self { Self :: Unit => TypeInfo :: StaticType ( crate :: UNIT_TYPE ) , Self :: Bool ( .. ) => TypeInfo :: StaticType ( crate :: BOOL_TYPE ) , Self :: Byte ( .. ) => TypeInfo :: StaticType ( crate :: BYTE_TYPE ) , Self :: Char ( .. ) => TypeInfo :: StaticType ( crate :: CHAR_TYPE ) , Self :: Integer ( .. ) => TypeInfo :: StaticType ( crate :: INTEGER_TYPE ) , Self :: Float ( .. ) => TypeInfo :: StaticType ( crate :: FLOAT_TYPE ) , Self :: StaticString ( .. ) => TypeInfo :: StaticType ( crate :: STRING_TYPE ) , Self :: String ( .. ) => TypeInfo :: StaticType ( crate :: STRING_TYPE ) , Self :: Bytes ( .. ) => TypeInfo :: StaticType ( crate :: BYTES_TYPE ) , Self :: Vec ( .. ) => TypeInfo :: StaticType ( crate :: VEC_TYPE ) , Self :: Tuple ( .. ) => TypeInfo :: StaticType ( crate :: TUPLE_TYPE ) , Self :: Object ( .. ) => TypeInfo :: StaticType ( crate :: OBJECT_TYPE ) , Self :: Range ( .. ) => TypeInfo :: StaticType ( crate :: RANGE_TYPE ) , Self :: Future ( .. ) => TypeInfo :: StaticType ( crate :: FUTURE_TYPE ) , Self :: Stream ( .. ) => TypeInfo :: StaticType ( crate :: STREAM_TYPE ) , Self :: Generator ( .. ) => TypeInfo :: StaticType ( crate :: GENERATOR_TYPE ) , Self :: GeneratorState ( .. ) => TypeInfo :: StaticType ( crate :: GENERATOR_STATE_TYPE ) , Self :: Option ( .. ) => TypeInfo :: StaticType ( crate :: OPTION_TYPE ) , Self :: Result ( .. ) => TypeInfo :: StaticType ( crate :: RESULT_TYPE ) , Self :: Function ( .. ) => TypeInfo :: StaticType ( crate :: FUNCTION_TYPE ) , Self :: Format ( .. ) => TypeInfo :: StaticType ( crate :: FORMAT_TYPE ) , Self :: Iterator ( .. ) => TypeInfo :: StaticType ( crate :: ITERATOR_TYPE ) , Self :: Type ( .. ) => TypeInfo :: StaticType ( crate :: TYPE ) , Self :: UnitStruct ( empty ) => empty . borrow_ref ( ) ? . type_info ( ) , Self :: TupleStruct ( tuple ) => tuple . borrow_ref ( ) ? . type_info ( ) , Self :: Struct ( object ) => object . borrow_ref ( ) ? . type_info ( ) , Self :: Variant ( empty ) => empty . borrow_ref ( ) ? . type_info ( ) , Self :: Any ( any ) => TypeInfo :: Any ( any . borrow_ref ( ) ? . type_name ( ) ) , } ) }
Get the type information for the current value.
Get the type information for the current value .
&self
&self