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