Enum dynasmrt::relocations::RelocationSize
source · pub enum RelocationSize {
Byte = 1,
Word = 2,
DWord = 4,
QWord = 8,
}
Expand description
A descriptor for the size of a relocation. This also doubles as a relocation itself
for relocations in data directives. Can be converted to relocations of any kind of architecture
using Relocation::from_size
.
Variants§
Byte = 1
A byte-sized relocation
Word = 2
A two-byte relocation
DWord = 4
A four-byte sized relocation
QWord = 8
An 8-byte sized relocation
Trait Implementations§
source§impl Clone for RelocationSize
impl Clone for RelocationSize
source§fn clone(&self) -> RelocationSize
fn clone(&self) -> RelocationSize
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 RelocationSize
impl Debug for RelocationSize
source§impl Hash for RelocationSize
impl Hash for RelocationSize
source§impl PartialEq for RelocationSize
impl PartialEq for RelocationSize
source§fn eq(&self, other: &RelocationSize) -> bool
fn eq(&self, other: &RelocationSize) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Relocation for RelocationSize
impl Relocation for RelocationSize
§type Encoding = u8
type Encoding = u8
The encoded representation for this relocation that is emitted by the dynasm! macro.
source§fn from_encoding(encoding: Self::Encoding) -> Self
fn from_encoding(encoding: Self::Encoding) -> Self
construct this relocation from an encoded representation.
source§fn from_size(size: RelocationSize) -> Self
fn from_size(size: RelocationSize) -> Self
construct this relocation from a simple size. This is used to implement relocations in directives and literal pools.
source§fn write_value(
&self,
buf: &mut [u8],
value: isize,
) -> Result<(), ImpossibleRelocation>
fn write_value( &self, buf: &mut [u8], value: isize, ) -> Result<(), ImpossibleRelocation>
Write a value into a buffer of size
self.size()
in the format of this relocation.
Any bits not part of the relocation should be preserved.source§fn read_value(&self, buf: &[u8]) -> isize
fn read_value(&self, buf: &[u8]) -> isize
Read a value from a buffer of size
self.size()
in the format of this relocation.source§fn kind(&self) -> RelocationKind
fn kind(&self) -> RelocationKind
Specifies what kind of relocation this relocation instance is.
impl Copy for RelocationSize
impl Eq for RelocationSize
impl StructuralPartialEq for RelocationSize
Auto Trait Implementations§
impl Freeze for RelocationSize
impl RefUnwindSafe for RelocationSize
impl Send for RelocationSize
impl Sync for RelocationSize
impl Unpin for RelocationSize
impl UnwindSafe for RelocationSize
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
)