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>

source

pub fn new() -> RelocRegistry<R>

Create a new, empty relocation registry.

source

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

source

pub fn add_static(&mut self, label: StaticLabel, patchloc: PatchLoc<R>)

Add a new patch targetting a static label (either global or local).

source

pub fn add_dynamic(&mut self, id: DynamicLabel, patchloc: PatchLoc<R>)

Add a new patch targetting the dynamic label id.

source

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.

source

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>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<R: Default + Relocation> Default for RelocRegistry<R>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.