[−][src]Struct dynasmrt::VecAssembler
An assembler that assembles into a Vec<u8>
, while supporting labels. To support the different types of relocations
it requires a base address of the to be assembled code to be specified.
Implementations
impl<R: Relocation> VecAssembler<R>
[src]
pub fn new(baseaddr: usize) -> VecAssembler<R>
[src]
Creates a new VecAssembler, with the specified base address.
pub fn commit(&mut self) -> Result<(), DynasmError>
[src]
Resolves any relocations emitted to the assembler before this point. If an impossible relocation was specified before this point, returns them here.
pub fn alter(&mut self) -> UncommittedModifier<'_>
[src]
Use an UncommittedModifier
to alter uncommitted code.
This does not allow the user to change labels/relocations.
pub fn finalize(mut self: Self) -> Result<Vec<u8>, DynasmError>
[src]
Finalizes the VecAssembler
, returning the resulting Vec<u8>
containing all assembled data.
this implicitly commits any relocations beforehand and returns an error if required.
Trait Implementations
impl<R: Debug + Relocation> Debug for VecAssembler<R>
[src]
impl<R: Relocation> DynasmApi for VecAssembler<R>
[src]
pub fn offset(&self) -> AssemblyOffset
[src]
pub fn push(&mut self, byte: u8)
[src]
pub fn align(&mut self, alignment: usize, with: u8)
[src]
pub fn push_i8(&mut self, value: i8)
[src]
pub fn push_i16(&mut self, value: i16)
[src]
pub fn push_i32(&mut self, value: i32)
[src]
pub fn push_i64(&mut self, value: i64)
[src]
pub fn push_u16(&mut self, value: u16)
[src]
pub fn push_u32(&mut self, value: u32)
[src]
pub fn push_u64(&mut self, value: u64)
[src]
pub fn runtime_error(&self, msg: &'static str) -> !
[src]
impl<R: Relocation> DynasmLabelApi for VecAssembler<R>
[src]
type Relocation = R
The relocation info type this assembler uses.
pub fn local_label(&mut self, name: &'static str)
[src]
pub fn global_label(&mut self, name: &'static str)
[src]
pub fn dynamic_label(&mut self, id: DynamicLabel)
[src]
pub fn global_relocation(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: R
)
[src]
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: R
)
pub fn dynamic_relocation(
&mut self,
id: DynamicLabel,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: R
)
[src]
&mut self,
id: DynamicLabel,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: R
)
pub fn forward_relocation(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: R
)
[src]
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: R
)
pub fn backward_relocation(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: R
)
[src]
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: R
)
pub fn bare_relocation(
&mut self,
target: usize,
field_offset: u8,
ref_offset: u8,
kind: R
)
[src]
&mut self,
target: usize,
field_offset: u8,
ref_offset: u8,
kind: R
)
pub fn forward_reloc(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
[src]
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
pub fn backward_reloc(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
[src]
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
pub fn global_reloc(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
[src]
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
pub fn dynamic_reloc(
&mut self,
id: DynamicLabel,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
[src]
&mut self,
id: DynamicLabel,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
pub fn bare_reloc(
&mut self,
target: usize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
[src]
&mut self,
target: usize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding
)
impl<'a, R: Relocation> Extend<&'a u8> for VecAssembler<R>
[src]
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = &'a u8>,
[src]
T: IntoIterator<Item = &'a u8>,
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<R: Relocation> Extend<u8> for VecAssembler<R>
[src]
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = u8>,
[src]
T: IntoIterator<Item = u8>,
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
Auto Trait Implementations
impl<R> RefUnwindSafe for VecAssembler<R> where
R: RefUnwindSafe,
[src]
R: RefUnwindSafe,
impl<R> Send for VecAssembler<R> where
R: Send,
[src]
R: Send,
impl<R> Sync for VecAssembler<R> where
R: Sync,
[src]
R: Sync,
impl<R> Unpin for VecAssembler<R> where
R: Unpin,
[src]
R: Unpin,
impl<R> UnwindSafe for VecAssembler<R> where
R: UnwindSafe,
[src]
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,