A trait for types that can be converted to and from static byte arrays
| 373 | |
| 374 | /// A trait for types that can be converted to and from static byte arrays |
| 375 | pub(crate) trait MemValue<const N: usize>: Copy + Default { |
| 376 | /// Store a value in memory |
| 377 | fn to_mem_bytes(self) -> [u8; N]; |
| 378 | |
| 379 | /// Load a value from memory |
| 380 | fn from_mem_bytes(bytes: [u8; N]) -> Self; |
| 381 | |
| 382 | fn load(mem: &dyn LinearMemory, base: u64, offset: u64) -> core::result::Result<Self, crate::Trap>; |
| 383 | } |
| 384 | |
| 385 | macro_rules! impl_mem_traits { |
| 386 | ($($ty:ty, $size:expr, $read:ident),* $(,)?) => { |
nothing calls this directly
no outgoing calls
no test coverage detected