Struct dynasmrt::UncommittedModifier
source · [−]pub struct UncommittedModifier<'a> { /* private fields */ }
Expand description
This struct is a wrapper around an Assembler
normally created using the
Assembler.alter_uncommitted
method. It allows the user to edit parts
of the assembling buffer that cannot be determined easily or efficiently
in advance. Due to limitations of the label resolution algorithms, this
assembler does not allow labels to be used.
Implementations
sourceimpl<'a> UncommittedModifier<'a>
impl<'a> UncommittedModifier<'a>
sourcepub fn new(
buffer: &mut Vec<u8>,
base_offset: AssemblyOffset
) -> UncommittedModifier<'_>
pub fn new(
buffer: &mut Vec<u8>,
base_offset: AssemblyOffset
) -> UncommittedModifier<'_>
create a new uncommittedmodifier
sourcepub fn goto(&mut self, offset: AssemblyOffset)
pub fn goto(&mut self, offset: AssemblyOffset)
Sets the current modification offset to the given value
sourcepub fn check(&mut self, offset: AssemblyOffset) -> Result<(), DynasmError>
pub fn check(&mut self, offset: AssemblyOffset) -> Result<(), DynasmError>
Checks that the current modification offset is not larger than the specified offset.
sourcepub fn check_exact(&mut self, offset: AssemblyOffset) -> Result<(), DynasmError>
pub fn check_exact(&mut self, offset: AssemblyOffset) -> Result<(), DynasmError>
Checks that the current modification offset is exactly the specified offset.
Trait Implementations
sourceimpl<'a> Debug for UncommittedModifier<'a>
impl<'a> Debug for UncommittedModifier<'a>
sourceimpl<'a> DynasmApi for UncommittedModifier<'a>
impl<'a> DynasmApi for UncommittedModifier<'a>
sourcefn offset(&self) -> AssemblyOffset
fn offset(&self) -> AssemblyOffset
Report the current offset into the assembling target
sourcefn align(&mut self, alignment: usize, with: u8)
fn align(&mut self, alignment: usize, with: u8)
Push filler until the assembling target end is aligned to the given alignment.
sourcefn runtime_error(&self, msg: &'static str) -> !
fn runtime_error(&self, msg: &'static str) -> !
This function is called in when a runtime error has to be generated. It panics.
sourceimpl<'a, 'b> Extend<&'b u8> for UncommittedModifier<'a>
impl<'a, 'b> Extend<&'b u8> for UncommittedModifier<'a>
sourcefn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = &'b u8>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = &'b u8>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<'a> Extend<u8> for UncommittedModifier<'a>
impl<'a> Extend<u8> for UncommittedModifier<'a>
sourcefn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = u8>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = u8>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for UncommittedModifier<'a>
impl<'a> Send for UncommittedModifier<'a>
impl<'a> Sync for UncommittedModifier<'a>
impl<'a> Unpin for UncommittedModifier<'a>
impl<'a> !UnwindSafe for UncommittedModifier<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more