pub enum RelocationSize {
Byte = 1,
Word = 2,
DWord = 4,
QWord = 8,
}Expand description
A simple size-based relocation descriptor for relocations in data directives.
Can be converted to a relocation for 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
Implementations§
Source§impl RelocationSize
impl RelocationSize
Sourcepub fn write_value(
&self,
buf: &mut [u8],
value: isize,
) -> Result<(), ImpossibleRelocation>
pub fn write_value( &self, buf: &mut [u8], value: isize, ) -> Result<(), ImpossibleRelocation>
Pack value into this relocation size and format it into buf
Sourcepub fn read_value(&self, buf: &[u8]) -> isize
pub fn read_value(&self, buf: &[u8]) -> isize
Extract a value of this size from buf
Trait Implementations§
Source§impl Clone for RelocationSize
impl Clone for RelocationSize
Source§fn clone(&self) -> RelocationSize
fn clone(&self) -> RelocationSize
Returns a duplicate 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
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