Struct dynasmrt::components::RelocRegistry
source · pub struct RelocRegistry<R: Relocation> { /* private fields */ }
Expand description
A registry of relocations and the respective labels they point towards.
Implementations§
source§impl<R: Relocation> RelocRegistry<R>
impl<R: Relocation> RelocRegistry<R>
sourcepub fn new() -> RelocRegistry<R>
pub fn new() -> RelocRegistry<R>
Create a new, empty relocation registry.
sourcepub fn with_capacity(
static_references: usize,
dynamic_references: usize,
) -> RelocRegistry<R>
pub fn with_capacity( static_references: usize, dynamic_references: usize, ) -> RelocRegistry<R>
Create a new, empty relocation registry with reserved space for the specified amount of static and dynamic references
sourcepub fn add_static(&mut self, label: StaticLabel, patchloc: PatchLoc<R>)
pub fn add_static(&mut self, label: StaticLabel, patchloc: PatchLoc<R>)
Add a new patch targetting a static label (either global or local).
sourcepub fn add_dynamic(&mut self, id: DynamicLabel, patchloc: PatchLoc<R>)
pub fn add_dynamic(&mut self, id: DynamicLabel, patchloc: PatchLoc<R>)
Add a new patch targetting the dynamic label id
.
sourcepub fn take_statics<'a>(
&'a mut self,
) -> impl Iterator<Item = (PatchLoc<R>, StaticLabel)> + 'a
pub fn take_statics<'a>( &'a mut self, ) -> impl Iterator<Item = (PatchLoc<R>, StaticLabel)> + 'a
Return an iterator through all defined relocations targeting global labels and the labels they target. These relocations are removed from the registry.
sourcepub fn take_dynamics<'a>(
&'a mut self,
) -> impl Iterator<Item = (PatchLoc<R>, DynamicLabel)> + 'a
pub fn take_dynamics<'a>( &'a mut self, ) -> impl Iterator<Item = (PatchLoc<R>, DynamicLabel)> + 'a
Return an iterator through all defined relocations targeting dynamic labels and the labels they target. These relocations are removed from the registry.
Trait Implementations§
source§impl<R: Debug + Relocation> Debug for RelocRegistry<R>
impl<R: Debug + Relocation> Debug for RelocRegistry<R>
source§impl<R: Default + Relocation> Default for RelocRegistry<R>
impl<R: Default + Relocation> Default for RelocRegistry<R>
source§fn default() -> RelocRegistry<R>
fn default() -> RelocRegistry<R>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<R> Freeze for RelocRegistry<R>
impl<R> RefUnwindSafe for RelocRegistry<R>where
R: RefUnwindSafe,
impl<R> Send for RelocRegistry<R>where
R: Send,
impl<R> Sync for RelocRegistry<R>where
R: Sync,
impl<R> Unpin for RelocRegistry<R>where
R: Unpin,
impl<R> UnwindSafe for RelocRegistry<R>where
R: UnwindSafe,
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