pub trait Memory {
type REG: Register;
Show 23 methods
// Required methods
fn new() -> Self;
fn new_with_memory(memory_size: usize) -> Self;
fn init_pages(
&mut self,
addr: u64,
size: u64,
flags: u8,
source: Option<Bytes>,
offset_from_addr: u64,
) -> Result<(), Error>;
fn fetch_flag(&mut self, page: u64) -> Result<u8, Error>;
fn set_flag(&mut self, page: u64, flag: u8) -> Result<(), Error>;
fn clear_flag(&mut self, page: u64, flag: u8) -> Result<(), Error>;
fn memory_size(&self) -> usize;
fn store_byte(
&mut self,
addr: u64,
size: u64,
value: u8,
) -> Result<(), Error>;
fn store_bytes(&mut self, addr: u64, value: &[u8]) -> Result<(), Error>;
fn load_bytes(&mut self, addr: u64, size: u64) -> Result<Bytes, Error>;
fn execute_load16(&mut self, addr: u64) -> Result<u16, Error>;
fn execute_load32(&mut self, addr: u64) -> Result<u32, Error>;
fn load8(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>;
fn load16(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>;
fn load32(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>;
fn load64(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>;
fn store8(
&mut self,
addr: &Self::REG,
value: &Self::REG,
) -> Result<(), Error>;
fn store16(
&mut self,
addr: &Self::REG,
value: &Self::REG,
) -> Result<(), Error>;
fn store32(
&mut self,
addr: &Self::REG,
value: &Self::REG,
) -> Result<(), Error>;
fn store64(
&mut self,
addr: &Self::REG,
value: &Self::REG,
) -> Result<(), Error>;
fn lr(&self) -> &Self::REG;
fn set_lr(&mut self, value: &Self::REG);
// Provided method
fn memory_pages(&self) -> usize { ... }
}
Required Associated Types§
Required Methods§
fn new() -> Self
fn new_with_memory(memory_size: usize) -> Self
fn init_pages( &mut self, addr: u64, size: u64, flags: u8, source: Option<Bytes>, offset_from_addr: u64, ) -> Result<(), Error>
fn fetch_flag(&mut self, page: u64) -> Result<u8, Error>
fn set_flag(&mut self, page: u64, flag: u8) -> Result<(), Error>
fn clear_flag(&mut self, page: u64, flag: u8) -> Result<(), Error>
fn memory_size(&self) -> usize
fn store_byte(&mut self, addr: u64, size: u64, value: u8) -> Result<(), Error>
fn store_bytes(&mut self, addr: u64, value: &[u8]) -> Result<(), Error>
fn load_bytes(&mut self, addr: u64, size: u64) -> Result<Bytes, Error>
fn execute_load16(&mut self, addr: u64) -> Result<u16, Error>
fn execute_load32(&mut self, addr: u64) -> Result<u32, Error>
fn load8(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>
fn load16(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>
fn load32(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>
fn load64(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>
fn store8(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>
fn store16(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>
fn store32(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>
fn store64(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>
fn lr(&self) -> &Self::REG
fn set_lr(&mut self, value: &Self::REG)
Provided Methods§
fn memory_pages(&self) -> usize
Object Safety§
This trait is not object safe.