Enum dynasmrt::relocations::RelocationKind
source · pub enum RelocationKind {
Relative = 0,
AbsToRel = 1,
RelToAbs = 2,
}
Expand description
Specifies what kind of relocation a relocation is.
Variants§
Relative = 0
A simple, PC-relative relocation. These can be encoded once and do not need to be adjusted when the executable buffer is moved.
AbsToRel = 1
An absolute relocation to a relative address, i.e. trying to put the address of a dynasm x86 function in a register This means adjustment is necessary when the executable buffer is moved
RelToAbs = 2
A relative relocation to an absolute address, i.e. trying to call a Rust function with a dynasm x86 call. This means adjustment is necessary when the executable buffer is moved
Implementations§
source§impl RelocationKind
impl RelocationKind
sourcepub fn from_encoding(encoding: u8) -> Self
pub fn from_encoding(encoding: u8) -> Self
Converts back from numeric value to RelocationKind
Trait Implementations§
source§impl Clone for RelocationKind
impl Clone for RelocationKind
source§fn clone(&self) -> RelocationKind
fn clone(&self) -> RelocationKind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RelocationKind
impl Debug for RelocationKind
source§impl Hash for RelocationKind
impl Hash for RelocationKind
source§impl PartialEq for RelocationKind
impl PartialEq for RelocationKind
source§fn eq(&self, other: &RelocationKind) -> bool
fn eq(&self, other: &RelocationKind) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for RelocationKind
impl Eq for RelocationKind
impl StructuralPartialEq for RelocationKind
Auto Trait Implementations§
impl Freeze for RelocationKind
impl RefUnwindSafe for RelocationKind
impl Send for RelocationKind
impl Sync for RelocationKind
impl Unpin for RelocationKind
impl UnwindSafe for RelocationKind
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)