pub enum Width {
U32,
U64,
}Expand description
The size of the address a relocation patches in.
A relocation writes a resolved address into a section as a little-endian integer of
this width. Pick the width that matches the slot the producer left: a 32-bit pointer
table uses U32, a 64-bit one uses U64. The link fails
with RelocationOverflow if a resolved address
does not fit the chosen width.
§Examples
use linker_lang::Width;
assert_eq!(Width::U32.bytes(), 4);
assert_eq!(Width::U64.bytes(), 8);Variants§
Implementations§
Trait Implementations§
impl Copy for Width
Source§impl<'de> Deserialize<'de> for Width
impl<'de> Deserialize<'de> for Width
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Width
impl StructuralPartialEq for Width
Auto Trait Implementations§
impl Freeze for Width
impl RefUnwindSafe for Width
impl Send for Width
impl Sync for Width
impl Unpin for Width
impl UnsafeUnpin for Width
impl UnwindSafe for Width
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