pub struct RawImage {
pub bytes: Vec<u8>,
pub load_addr: u64,
}Expand description
A flat byte image mapped at load_addr.
Fields§
§bytes: Vec<u8>§load_addr: u64Implementations§
Source§impl RawImage
impl RawImage
Sourcepub fn new(bytes: Vec<u8>, load_addr: u64) -> Self
pub fn new(bytes: Vec<u8>, load_addr: u64) -> Self
Construct an image from bytes mapped at load_addr.
Sourcepub fn offset_of(&self, addr: u64) -> Option<usize>
pub fn offset_of(&self, addr: u64) -> Option<usize>
Translate a virtual address into a byte offset, or None if
the address is outside the image.
Sourcepub fn read_u16_le(&self, addr: u64) -> Result<u16>
pub fn read_u16_le(&self, addr: u64) -> Result<u16>
Read a little-endian 16-bit word at addr. Used to read 6502
vectors (read_u16_le(0xFFFC) is the reset vector).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawImage
impl RefUnwindSafe for RawImage
impl Send for RawImage
impl Sync for RawImage
impl Unpin for RawImage
impl UnsafeUnpin for RawImage
impl UnwindSafe for RawImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more