pub trait Memory {
// Required methods
fn size(&self) -> u64;
fn grow(&self, pages: u64) -> i64;
fn read(&self, offset: u64, bytes: &mut [u8]);
fn write(&self, offset: u64, bytes: &[u8]);
}Expand description
Memory
Page-addressed backing for Storage. Growth returns the previous page count, or -1 without changing memory. Successful growth adds zero-filled pages. Reads and writes must reject the complete out-of-bounds range before IO. Implementing this trait alone does not grant allocation authority.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".