Struct AssemblerConfig
pub struct AssemblerConfig {
pub dialect: Dialect,
pub symbol_resolver: Option<Arc<dyn Fn(&str) -> Option<u64> + Send + Sync + 'static>>,
}
Expand description
This structure exposes the different elements that can be configured to assemble code.
Fields§
§dialect: Dialect
Default configuration
symbol_resolver: Option<Arc<dyn Fn(&str) -> Option<u64> + Send + Sync + 'static>>
This attribute aims to store a function for resolving symbols in the assembly listing.
For instance, given this assembly code:
0x1000: mov rdi, rbx
0x1003: call _my_function
The function _my_function
will remain undefined unless we return its address
in a callback defined in this attribute AssemblerConfig::symbol_resolver
:
let mut config = AssemblerConfig::default();
let resolver = Arc::new(move |symbol: &str| {
return Some(0x4000);
});
config.symbol_resolver = Some(resolver);
Trait Implementations§
§impl Clone for AssemblerConfig
impl Clone for AssemblerConfig
§fn clone(&self) -> AssemblerConfig
fn clone(&self) -> AssemblerConfig
Returns a duplicate 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 more§impl Default for AssemblerConfig
impl Default for AssemblerConfig
§fn default() -> AssemblerConfig
fn default() -> AssemblerConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AssemblerConfig
impl !RefUnwindSafe for AssemblerConfig
impl Send for AssemblerConfig
impl Sync for AssemblerConfig
impl Unpin for AssemblerConfig
impl !UnwindSafe for AssemblerConfig
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