@ -340,145 +340,157 @@ impl VMGlobalDefinition {
/// Return a reference to the value as an i32.
/// Return a reference to the value as an i32.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_i32 ( & self ) -> & i32 {
pub unsafe fn as_i32 ( & self ) -> & i32 {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const i32 )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< i32 > ( ) )
}
}
/// Return a mutable reference to the value as an i32.
/// Return a mutable reference to the value as an i32.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_i32_mut ( & mut self ) -> & mut i32 {
pub unsafe fn as_i32_mut ( & mut self ) -> & mut i32 {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut i32 )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< i32 > ( ) )
}
}
/// Return a reference to the value as a u32.
/// Return a reference to the value as a u32.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_u32 ( & self ) -> & u32 {
pub unsafe fn as_u32 ( & self ) -> & u32 {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const u32 )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< u32 > ( ) )
}
}
/// Return a mutable reference to the value as an u32.
/// Return a mutable reference to the value as an u32.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_u32_mut ( & mut self ) -> & mut u32 {
pub unsafe fn as_u32_mut ( & mut self ) -> & mut u32 {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut u32 )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< u32 > ( ) )
}
}
/// Return a reference to the value as an i64.
/// Return a reference to the value as an i64.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_i64 ( & self ) -> & i64 {
pub unsafe fn as_i64 ( & self ) -> & i64 {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const i64 )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< i64 > ( ) )
}
}
/// Return a mutable reference to the value as an i64.
/// Return a mutable reference to the value as an i64.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_i64_mut ( & mut self ) -> & mut i64 {
pub unsafe fn as_i64_mut ( & mut self ) -> & mut i64 {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut i64 )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< i64 > ( ) )
}
}
/// Return a reference to the value as an u64.
/// Return a reference to the value as an u64.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_u64 ( & self ) -> & u64 {
pub unsafe fn as_u64 ( & self ) -> & u64 {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const u64 )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< u64 > ( ) )
}
}
/// Return a mutable reference to the value as an u64.
/// Return a mutable reference to the value as an u64.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_u64_mut ( & mut self ) -> & mut u64 {
pub unsafe fn as_u64_mut ( & mut self ) -> & mut u64 {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut u64 )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< u64 > ( ) )
}
}
/// Return a reference to the value as an f32.
/// Return a reference to the value as an f32.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_f32 ( & self ) -> & f32 {
pub unsafe fn as_f32 ( & self ) -> & f32 {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const f32 )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< f32 > ( ) )
}
}
/// Return a mutable reference to the value as an f32.
/// Return a mutable reference to the value as an f32.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_f32_mut ( & mut self ) -> & mut f32 {
pub unsafe fn as_f32_mut ( & mut self ) -> & mut f32 {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut f32 )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< f32 > ( ) )
}
}
/// Return a reference to the value as f32 bits.
/// Return a reference to the value as f32 bits.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_f32_bits ( & self ) -> & u32 {
pub unsafe fn as_f32_bits ( & self ) -> & u32 {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const u32 )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< u32 > ( ) )
}
}
/// Return a mutable reference to the value as f32 bits.
/// Return a mutable reference to the value as f32 bits.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_f32_bits_mut ( & mut self ) -> & mut u32 {
pub unsafe fn as_f32_bits_mut ( & mut self ) -> & mut u32 {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut u32 )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< u32 > ( ) )
}
}
/// Return a reference to the value as an f64.
/// Return a reference to the value as an f64.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_f64 ( & self ) -> & f64 {
pub unsafe fn as_f64 ( & self ) -> & f64 {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const f64 )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< f64 > ( ) )
}
}
/// Return a mutable reference to the value as an f64.
/// Return a mutable reference to the value as an f64.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_f64_mut ( & mut self ) -> & mut f64 {
pub unsafe fn as_f64_mut ( & mut self ) -> & mut f64 {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut f64 )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< f64 > ( ) )
}
}
/// Return a reference to the value as f64 bits.
/// Return a reference to the value as f64 bits.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_f64_bits ( & self ) -> & u64 {
pub unsafe fn as_f64_bits ( & self ) -> & u64 {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const u64 )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< u64 > ( ) )
}
}
/// Return a mutable reference to the value as f64 bits.
/// Return a mutable reference to the value as f64 bits.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_f64_bits_mut ( & mut self ) -> & mut u64 {
pub unsafe fn as_f64_bits_mut ( & mut self ) -> & mut u64 {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut u64 )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< u64 > ( ) )
}
}
/// Return a reference to the value as an u128.
/// Return a reference to the value as an u128.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_u128 ( & self ) -> & u128 {
pub unsafe fn as_u128 ( & self ) -> & u128 {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const u128 )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< u128 > ( ) )
}
}
/// Return a mutable reference to the value as an u128.
/// Return a mutable reference to the value as an u128.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_u128_mut ( & mut self ) -> & mut u128 {
pub unsafe fn as_u128_mut ( & mut self ) -> & mut u128 {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut u128 )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< u128 > ( ) )
}
}
/// Return a reference to the value as u128 bits.
/// Return a reference to the value as u128 bits.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_u128_bits ( & self ) -> & [ u8 ; 16 ] {
pub unsafe fn as_u128_bits ( & self ) -> & [ u8 ; 16 ] {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const [ u8 ; 16 ] )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< [ u8 ; 16 ] > ( ) )
}
}
/// Return a mutable reference to the value as u128 bits.
/// Return a mutable reference to the value as u128 bits.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_u128_bits_mut ( & mut self ) -> & mut [ u8 ; 16 ] {
pub unsafe fn as_u128_bits_mut ( & mut self ) -> & mut [ u8 ; 16 ] {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut [ u8 ; 16 ] )
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) . cast ::< [ u8 ; 16 ] > ( ) )
}
}
/// Return a reference to the value as an externref.
/// Return a reference to the value as an externref.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_externref ( & self ) -> & Option < VMExternRef > {
pub unsafe fn as_externref ( & self ) -> & Option < VMExternRef > {
& * ( self . storage . as_ref ( ) . as_ptr ( ) as * const Option < VMExternRef > )
& * ( self . storage . as_ref ( ) . as_ptr ( ) . cast ::< Option < VMExternRef > > ( ) )
}
}
/// Return a mutable reference to the value as an externref.
/// Return a mutable reference to the value as an externref.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_externref_mut ( & mut self ) -> & mut Option < VMExternRef > {
pub unsafe fn as_externref_mut ( & mut self ) -> & mut Option < VMExternRef > {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut Option < VMExternRef > )
& mut * ( self
. storage
. as_mut ( )
. as_mut_ptr ( )
. cast ::< Option < VMExternRef > > ( ) )
}
}
/// Return a reference to the value as an anyfunc.
/// Return a reference to the value as an anyfunc.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_anyfunc ( & self ) -> * const VMCallerCheckedAnyfunc {
pub unsafe fn as_anyfunc ( & self ) -> * const VMCallerCheckedAnyfunc {
* ( self . storage . as_ref ( ) . as_ptr ( ) as * const * const VMCallerCheckedAnyfunc )
* ( self
. storage
. as_ref ( )
. as_ptr ( )
. cast ::< * const VMCallerCheckedAnyfunc > ( ) )
}
}
/// Return a mutable reference to the value as an anyfunc.
/// Return a mutable reference to the value as an anyfunc.
#[ allow(clippy::cast_ptr_alignment) ]
#[ allow(clippy::cast_ptr_alignment) ]
pub unsafe fn as_anyfunc_mut ( & mut self ) -> & mut * const VMCallerCheckedAnyfunc {
pub unsafe fn as_anyfunc_mut ( & mut self ) -> & mut * const VMCallerCheckedAnyfunc {
& mut * ( self . storage . as_mut ( ) . as_mut_ptr ( ) as * mut * const VMCallerCheckedAnyfunc )
& mut * ( self
. storage
. as_mut ( )
. as_mut_ptr ( )
. cast ::< * const VMCallerCheckedAnyfunc > ( ) )
}
}
}
}