Trait MemoryView

Source
pub trait MemoryView<Store: Store>:
    Send
    + MemoryWritable<Store>
    + MemoryReadable<Store> {
    // Required method
    fn check_bounds(
        &self,
        store: &mut <Store as Store>::ActualStore<'_>,
        offset: u32,
        size: u32,
    ) -> Result<(), MemoryAccessError>;
}

Required Methods§

Source

fn check_bounds( &self, store: &mut <Store as Store>::ActualStore<'_>, offset: u32, size: u32, ) -> Result<(), MemoryAccessError>

For optimization purposes, user must check bounds first, then try read-write to memory MemoryWritable and MemoryReadable functions will panic in case of out of bounds access`

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§