From 395a6dc683bcb687ad5fd1c5b1b63205ffd1af79 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Thu, 7 Aug 2025 22:53:00 -0700 Subject: [Rust] Add builder API for creating workflows `Workflow::new` is replaced by `Workflow::build` that returns a `Builder` type that supports the operations that mutate a workflow, such as registering activities. `Workflow::instance` is replaced by `Workflow::get` to make clear that it is intended to look up an existing workflow. `Workflow::cloned` is introduced to wrap the common pattern of retrieving an existing workflow and cloning it with the same name in order to modify it. `Builder::activity_before` / `Builder::activity_after` are introduced to wrap the common pattern of registering an activity then inserting it before or after a given activity. --- rust/examples/workflow.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/examples') diff --git a/rust/examples/workflow.rs b/rust/examples/workflow.rs index 49560579..db0bf599 100644 --- a/rust/examples/workflow.rs +++ b/rust/examples/workflow.rs @@ -52,7 +52,7 @@ pub fn main() { binaryninja::headless::Session::new().expect("Failed to initialize session"); println!("Registering workflow..."); - let old_meta_workflow = Workflow::instance("core.function.metaAnalysis"); + let old_meta_workflow = Workflow::get("core.function.metaAnalysis"); let meta_workflow = old_meta_workflow.clone_to("core.function.metaAnalysis"); let activity = Activity::new_with_action(RUST_ACTIVITY_CONFIG, example_activity); meta_workflow.register_activity(&activity).unwrap(); -- cgit v1.3.1