Struct dynasmrt::SimpleAssembler
source · [−]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
sourceimpl 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
sourceimpl Clone for SimpleAssembler
impl Clone for SimpleAssembler
sourcefn clone(&self) -> SimpleAssembler
fn clone(&self) -> SimpleAssembler
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for SimpleAssembler
impl Debug for SimpleAssembler
sourceimpl DynasmApi for SimpleAssembler
impl DynasmApi for SimpleAssembler
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> Extend<&'a u8> for SimpleAssembler
impl<'a> Extend<&'a u8> for SimpleAssembler
sourcefn 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
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 Extend<u8> for SimpleAssembler
impl Extend<u8> for SimpleAssembler
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 RefUnwindSafe for SimpleAssembler
impl Send for SimpleAssembler
impl Sync for SimpleAssembler
impl Unpin for SimpleAssembler
impl UnwindSafe for SimpleAssembler
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