CustomScriptingInstance

Trait CustomScriptingInstance 

Source
pub trait CustomScriptingInstance {
    // Required methods
    fn execute_script_input(
        &self,
        instance: &ScriptingInstance,
        input: &str,
    ) -> ScriptingProviderExecuteResult;
    fn execute_script_input_from_file(
        &self,
        instance: &ScriptingInstance,
        file_path: &Path,
    ) -> ScriptingProviderExecuteResult;

    // Provided methods
    fn cancel_script_input(&self) { ... }
    fn release_binary_view(&self, _view: &BinaryView) { ... }
    fn set_current_binary_view(&self, _view: Option<&BinaryView>) { ... }
    fn set_current_function(&self, _func: Option<&Function>) { ... }
    fn set_current_basic_block(&self, _block: Option<&BasicBlock<NativeBlock>>) { ... }
    fn set_current_selection(&self, _begin: u64, _end: u64) { ... }
    fn complete_input(&self, _text: &str, _state: u64) -> String { ... }
    fn can_complete_arguments(&self, _text: &str) -> bool { ... }
    fn complete_arguments(&self, _text: &str) -> (String, u64) { ... }
    fn stop(&self) { ... }
}

Required Methods§

Provided Methods§

Source

fn cancel_script_input(&self)

Called when the user requests that the current executing input be canceled.

Source

fn release_binary_view(&self, _view: &BinaryView)

Called when the binary view is no longer available.

This function should release any resources associated with the binary view.

Source

fn set_current_binary_view(&self, _view: Option<&BinaryView>)

Called when the current binary view is changed.

The view will be None if there is no current binary view.

Source

fn set_current_function(&self, _func: Option<&Function>)

Called when the current function is changed.

The func will be None if there is no current function.

Source

fn set_current_basic_block(&self, _block: Option<&BasicBlock<NativeBlock>>)

Called when the current basic block is changed.

The block will be None if there is no current basic block.

Source

fn set_current_selection(&self, _begin: u64, _end: u64)

Called when the current selected address range is changed.

Source

fn complete_input(&self, _text: &str, _state: u64) -> String

Source

fn can_complete_arguments(&self, _text: &str) -> bool

Called to check whether the user can complete arguments from the given string.

Make sure to override this and CustomScriptingInstance::complete_arguments to enable argument completion.

Source

fn complete_arguments(&self, _text: &str) -> (String, u64)

Called when the user requests completion of arguments.

Make sure to override this and CustomScriptingInstance::can_complete_arguments to enable argument completion.

Returns the completion string with the character position in the string to place the popup at.

Source

fn stop(&self)

Perform cleanup of resources, this is called before the instance destructor is called.

NOTE: Due to usage being potentially identical to when the instance is dropped, this may be removed in the future.

Implementors§