MemoryModuleBuilder

Struct MemoryModuleBuilder 

Source
pub struct MemoryModuleBuilder {
    pub resolve_imports: bool,
    pub process_relocations: bool,
    pub call_dll_main: bool,
    pub ignore_missing_imports: bool,
    pub alloc_function: Option<CustomAllocFunction>,
    pub free_function: Option<CustomFreeFunction>,
    pub load_library_function: Option<CustomLoadLibraryFunction>,
    pub get_proc_address_function: Option<CustomGetProcAddressFunction>,
    pub free_library_function: Option<CustomFreeLibraryFunction>,
    pub user_data: *mut c_void,
}

Fields§

§resolve_imports: bool§process_relocations: bool§call_dll_main: bool§ignore_missing_imports: bool§alloc_function: Option<CustomAllocFunction>§free_function: Option<CustomFreeFunction>§load_library_function: Option<CustomLoadLibraryFunction>§get_proc_address_function: Option<CustomGetProcAddressFunction>§free_library_function: Option<CustomFreeLibraryFunction>§user_data: *mut c_void

Implementations§

Source§

impl MemoryModuleBuilder

Source

pub fn new() -> Self

Source

pub fn resolve_imports(self, resolve: bool) -> Self

Source

pub fn process_relocations(self, process: bool) -> Self

Source

pub fn call_dll_main(self, call: bool) -> Self

Source

pub fn ignore_missing_imports(self, ignore: bool) -> Self

Source

pub fn alloc_function(self, func: CustomAllocFunction) -> Self

Source

pub fn free_function(self, func: CustomFreeFunction) -> Self

Source

pub fn load_library_function(self, func: CustomLoadLibraryFunction) -> Self

Source

pub fn get_proc_address_function( self, func: CustomGetProcAddressFunction, ) -> Self

Source

pub fn free_library_function(self, func: CustomFreeLibraryFunction) -> Self

Source

pub fn user_data(self, data: *mut c_void) -> Self

Source

pub fn load_from_memory(self, data: &[u8]) -> Result<Box<dyn MemoryModule>>

Trait Implementations§

Source§

impl Default for MemoryModuleBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.