pub struct AddressMap { /* private fields */ }Expand description
Sorted, non-overlapping file and virtual address mappings.
Implementations§
Source§impl AddressMap
impl AddressMap
Sourcepub fn try_new(entries: Vec<MappingEntry>) -> Result<AddressMap, ParseError>
pub fn try_new(entries: Vec<MappingEntry>) -> Result<AddressMap, ParseError>
Validate, stably sort, and construct an address map.
Sourcepub fn entries(&self) -> &[MappingEntry]
pub fn entries(&self) -> &[MappingEntry]
Validated mappings in stable file-offset order.
Sourcepub fn thin_offset_to_va(
&self,
offset: ThinFileOffset,
) -> Result<Va, ParseError>
pub fn thin_offset_to_va( &self, offset: ThinFileOffset, ) -> Result<Va, ParseError>
Convert a thin-image-relative file offset to a virtual address.
Sourcepub fn va_to_thin_offset(&self, va: Va) -> Result<ThinFileOffset, ParseError>
pub fn va_to_thin_offset(&self, va: Va) -> Result<ThinFileOffset, ParseError>
Convert a virtual address to a thin-image-relative file offset.
Sourcepub fn rva_to_va(rva: Rva, image_base: Va) -> Result<Va, ParseError>
pub fn rva_to_va(rva: Rva, image_base: Va) -> Result<Va, ParseError>
Convert an RVA to a VA with checked arithmetic.
Sourcepub fn va_to_rva(va: Va, image_base: Va) -> Result<Rva, ParseError>
pub fn va_to_rva(va: Va, image_base: Va) -> Result<Rva, ParseError>
Convert a VA to an RVA, rejecting addresses before the image base.
Sourcepub fn rva_to_thin_offset(
&self,
rva: Rva,
image_base: Va,
) -> Result<ThinFileOffset, ParseError>
pub fn rva_to_thin_offset( &self, rva: Rva, image_base: Va, ) -> Result<ThinFileOffset, ParseError>
Convert an RVA to a thin-image-relative file offset.
Trait Implementations§
Source§impl Clone for AddressMap
impl Clone for AddressMap
Source§fn clone(&self) -> AddressMap
fn clone(&self) -> AddressMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AddressMap
impl RefUnwindSafe for AddressMap
impl Send for AddressMap
impl Sync for AddressMap
impl Unpin for AddressMap
impl UnsafeUnpin for AddressMap
impl UnwindSafe for AddressMap
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