pub struct FlowGraph { /* private fields */ }Implementations§
Source§impl FlowGraph
impl FlowGraph
Sourcepub fn new() -> Ref<Self>
pub fn new() -> Ref<Self>
Create an empty flowgraph.
If you instead want to create a flowgraph of a given Function, use Function::create_graph.
Sourcepub fn request_layout<C: FnOnce() + Send + 'static>(
&self,
on_complete: C,
) -> Ref<FlowGraphLayoutRequest>
pub fn request_layout<C: FnOnce() + Send + 'static>( &self, on_complete: C, ) -> Ref<FlowGraphLayoutRequest>
Requests the flowgraph to be laid out, positioning nodes and routing edges.
This function returns immediately, with on_complete being called when the layout has been
completed, to wait for the request to be completed use FlowGraph::request_layout_and_wait.
Sourcepub fn request_layout_and_wait(&self, timeout: Duration) -> bool
pub fn request_layout_and_wait(&self, timeout: Duration) -> bool
Blocks until the flow graph layout is complete or until the timeout has elapsed, returning
true if the layout completed within the timeout, false otherwise.
Use FlowGraph::request_layout instead if you want to provide a callback when the layout
has been completed and return immediately.
pub fn has_updates(&self) -> bool
pub fn update(&self) -> Option<Ref<Self>>
Sourcepub fn show(&self, title: &str)
pub fn show(&self, title: &str)
Sends the FlowGraph to the interaction handlers to display.
- On headless this is a no-op unless you register a
crate::interaction::handler::InteractionHandler. - On UI this will create a new tab to display the graph.
Sourcepub fn is_layout_complete(&self) -> bool
pub fn is_layout_complete(&self) -> bool
Whether the flow graph layout is complete.
pub fn nodes(&self) -> Array<FlowGraphNode>
Sourcepub fn visible_nodes(
&self,
left: i32,
top: i32,
right: i32,
bottom: i32,
) -> Array<FlowGraphNode>
pub fn visible_nodes( &self, left: i32, top: i32, right: i32, bottom: i32, ) -> Array<FlowGraphNode>
Returns the nodes that are partially or fully visible within the given region.
The node visibility region is set with FlowGraphNode::set_visibility_region when laying
out the graph.
pub fn function(&self) -> Option<Ref<Function>>
pub fn set_function(&self, func: Option<&Function>)
pub fn view(&self) -> Option<Ref<BinaryView>>
pub fn set_view(&self, view: Option<&BinaryView>)
pub fn lifted_il(&self) -> Option<Ref<LowLevelILRegularFunction>>
pub fn low_level_il(&self) -> Option<Ref<LowLevelILRegularFunction>>
pub fn medium_level_il(&self) -> Option<Ref<MediumLevelILFunction>>
pub fn high_level_il(&self, full_ast: bool) -> Option<Ref<HighLevelILFunction>>
pub fn get_node(&self, i: usize) -> Option<Ref<FlowGraphNode>>
pub fn get_node_count(&self) -> usize
pub fn has_nodes(&self) -> bool
Sourcepub fn node_margins(&self) -> (i32, i32)
pub fn node_margins(&self) -> (i32, i32)
Returns the graph margins between nodes.
Sourcepub fn set_node_margins(&self, horizontal: i32, vertical: i32)
pub fn set_node_margins(&self, horizontal: i32, vertical: i32)
Sets the graph margins between nodes.
pub fn is_node_valid(&self, node: &FlowGraphNode) -> bool
Sourcepub fn append(&self, node: &FlowGraphNode) -> usize
pub fn append(&self, node: &FlowGraphNode) -> usize
Add a FlowGraphNode to the graph, returning its index.
This only works before the flow graph layout is complete, inside layout::FlowGraphLayout::layout.
Sourcepub fn replace(&self, index: usize, node: &FlowGraphNode)
pub fn replace(&self, index: usize, node: &FlowGraphNode)
Replaces the node at the given index with the provided FlowGraphNode.
This only works before the flow graph layout is complete, inside layout::FlowGraphLayout::layout.
Sourcepub fn clear(&self)
pub fn clear(&self)
Removes all nodes from the graph.
This only works before the flow graph layout is complete, inside layout::FlowGraphLayout::layout.
pub fn set_option(&self, option: FlowGraphOption, value: bool)
pub fn is_option_set(&self, option: FlowGraphOption) -> bool
Sourcepub fn render_layers(&self) -> Array<CoreRenderLayer>
pub fn render_layers(&self) -> Array<CoreRenderLayer>
A list of the currently applied CoreRenderLayer’s
Sourcepub fn add_render_layer(&self, layer: &CoreRenderLayer)
pub fn add_render_layer(&self, layer: &CoreRenderLayer)
Add a Render Layer to be applied to this FlowGraph.
NOTE: Layers will be applied in the order in which they are added.
Sourcepub fn remove_render_layer(&self, layer: &CoreRenderLayer)
pub fn remove_render_layer(&self, layer: &CoreRenderLayer)
Remove a Render Layer from being applied to this FlowGraph.