Struct dynasmrt::SimpleAssembler
source · pub struct SimpleAssembler {
pub ops: Vec<u8>,
}
Expand description
An assembler that is purely a Vec<u8>
. It doesn’t support labels or architecture-specific directives,
but can be used to easily inspect generated code. It is intended to be used in testcases.
Fields§
§ops: Vec<u8>
The assembling buffer.
Implementations§
source§impl SimpleAssembler
impl SimpleAssembler
sourcepub fn new() -> SimpleAssembler
pub fn new() -> SimpleAssembler
Creates a new SimpleAssembler
, containing an empty Vec
.
sourcepub fn alter(&mut self) -> UncommittedModifier<'_>
pub fn alter(&mut self) -> UncommittedModifier<'_>
Use an UncommittedModifier
to alter uncommitted code.
Trait Implementations§
source§impl Clone for SimpleAssembler
impl Clone for SimpleAssembler
source§fn clone(&self) -> SimpleAssembler
fn clone(&self) -> SimpleAssembler
Returns a copy 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 SimpleAssembler
impl Debug for SimpleAssembler
source§impl DynasmApi for SimpleAssembler
impl DynasmApi for SimpleAssembler
source§fn offset(&self) -> AssemblyOffset
fn offset(&self) -> AssemblyOffset
Report the current offset into the assembling target
source§fn 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.
source§fn 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.
source§impl<'a> Extend<&'a u8> for SimpleAssembler
impl<'a> Extend<&'a u8> for SimpleAssembler
source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = &'a u8>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = &'a u8>,
Extends a collection with the contents of an iterator. Read more
source§fn 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.
source§fn 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
source§impl Extend<u8> for SimpleAssembler
impl Extend<u8> for SimpleAssembler
source§fn 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
source§fn 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.
source§fn 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 Freeze for SimpleAssembler
impl RefUnwindSafe for SimpleAssembler
impl Send for SimpleAssembler
impl Sync for SimpleAssembler
impl Unpin for SimpleAssembler
impl UnwindSafe for SimpleAssembler
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)