pub struct Rva(pub u32);
Expand description
A Relative Virtual Address as it appears in a PE file.
RVAs are always relative to the image base address, as it is loaded into process memory. This address is reported by debuggers in stack traces and may refer to symbols or instruction pointers.
Tuple Fields
0: u32
Implementations
sourceimpl Rva
impl Rva
sourcepub fn checked_add(self, offset: u32) -> Option<Self>
pub fn checked_add(self, offset: u32) -> Option<Self>
Checked addition of an offset. Returns None
if overflow occurred.
sourcepub fn checked_sub(self, other: Self) -> Option<u32>
pub fn checked_sub(self, other: Self) -> Option<u32>
Checked computation of an offset between two addresses. Returns None
if other
is
larger.
sourcepub fn saturating_add(self, offset: u32) -> Self
pub fn saturating_add(self, offset: u32) -> Self
Saturating addition of an offset, clipped at the numeric bounds.
sourcepub fn saturating_sub(self, other: Self) -> u32
pub fn saturating_sub(self, other: Self) -> u32
Saturating computation of an offset between two addresses, clipped at zero.
sourcepub fn wrapping_add(self, offset: u32) -> Self
pub fn wrapping_add(self, offset: u32) -> Self
Wrapping (modular) addition of an offset.
sourcepub fn wrapping_sub(self, other: Self) -> u32
pub fn wrapping_sub(self, other: Self) -> u32
Wrapping (modular) computation of an offset between two addresses.
sourceimpl Rva
impl Rva
sourcepub fn to_internal_rva(
self,
translator: &AddressMap<'_>
) -> Option<PdbInternalRva>
pub fn to_internal_rva(
self,
translator: &AddressMap<'_>
) -> Option<PdbInternalRva>
Resolves a PDB-internal Relative Virtual Address.
This address is not necessarily compatible with the executable’s address space and should therefore not be used for debugging purposes.
sourcepub fn to_section_offset(
self,
translator: &AddressMap<'_>
) -> Option<SectionOffset>
pub fn to_section_offset(
self,
translator: &AddressMap<'_>
) -> Option<SectionOffset>
Resolves the section offset in the PE headers.
This is an offset into PE section headers of the executable. To retrieve section offsets
used in the PDB, use to_internal_offset
instead.
sourcepub fn to_internal_offset(
self,
translator: &AddressMap<'_>
) -> Option<PdbInternalSectionOffset>
pub fn to_internal_offset(
self,
translator: &AddressMap<'_>
) -> Option<PdbInternalSectionOffset>
Resolves the PDB internal section offset.
This is the offset value used in the PDB file. To index into the actual PE section headers,
use to_section_offset
instead.
Trait Implementations
sourceimpl AddAssign<u32> for Rva
impl AddAssign<u32> for Rva
sourcefn add_assign(&mut self, offset: u32)
fn add_assign(&mut self, offset: u32)
Adds the given offset to this address.
sourceimpl Ord for Rva
impl Ord for Rva
sourceimpl PartialOrd<Rva> for Rva
impl PartialOrd<Rva> for Rva
sourcefn partial_cmp(&self, other: &Rva) -> Option<Ordering>
fn partial_cmp(&self, other: &Rva) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Rva
impl Eq for Rva
impl StructuralEq for Rva
impl StructuralPartialEq for Rva
Auto Trait Implementations
impl RefUnwindSafe for Rva
impl Send for Rva
impl Sync for Rva
impl Unpin for Rva
impl UnwindSafe for Rva
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more