pub unsafe trait MemorySize: Copy {
    type Offset: Default + Debug + Display + Eq + Ord + PartialEq<Self::Offset> + PartialOrd<Self::Offset> + Clone + Copy + ValueType + Into<u64> + From<u32> + From<u16> + From<u8> + TryFrom<u64> + TryFrom<u32> + TryFrom<u16> + TryFrom<u8> + TryInto<usize> + TryInto<u64> + TryInto<u32> + TryInto<u16> + TryInto<u8> + TryFrom<usize> + Add<Self::Offset> + Sum<Self::Offset> + AddAssign<Self::Offset>;
    type Native: NativeWasmType;

    const ZERO: Self::Offset;
    const ONE: Self::Offset;

    fn offset_to_native(offset: Self::Offset) -> Self::Native;
    fn native_to_offset(native: Self::Native) -> Self::Offset;
}
Expand description

Trait for the Memory32 and Memory64 marker types.

This allows code to be generic over 32-bit and 64-bit memories.

Safety

Direct memory access is unsafe

Required Associated Types

Type used to represent an offset into a memory. This is u32 or u64.

Type used to pass this value as an argument or return value for a Wasm function.

Required Associated Constants

Zero value used for WasmPtr::is_null.

One value used for counting.

Required Methods

Convert an Offset to a Native.

Convert a Native to an Offset.

Implementors