diff options
| -rw-r--r-- | rust/src/collaboration.rs | 2 | ||||
| -rw-r--r-- | rust/src/headless.rs | 19 | ||||
| -rw-r--r-- | rust/src/lib.rs | 2 | ||||
| -rw-r--r-- | rust/tests/collaboration.rs | 4 |
4 files changed, 19 insertions, 8 deletions
diff --git a/rust/src/collaboration.rs b/rust/src/collaboration.rs index e173afaa..c9067762 100644 --- a/rust/src/collaboration.rs +++ b/rust/src/collaboration.rs @@ -37,7 +37,7 @@ use crate::string::{BnStrCompatible, BnString}; // TODO: the data because they have a greater understanding of where the function is being called from. /// Check whether the client has collaboration support. -/// +/// /// Call this if you intend on providing divergent behavior, as otherwise you will likely /// crash calling collaboration APIs on unsupported builds of Binary Ninja. pub fn has_collaboration_support() -> bool { diff --git a/rust/src/headless.rs b/rust/src/headless.rs index 23892079..2642b2b0 100644 --- a/rust/src/headless.rs +++ b/rust/src/headless.rs @@ -22,13 +22,13 @@ use thiserror::Error; use crate::enterprise::release_license; use crate::main_thread::{MainThreadAction, MainThreadHandler}; +use crate::progress::ProgressCallback; use crate::rc::Ref; use binaryninjacore_sys::{BNInitPlugins, BNInitRepoPlugins}; use std::sync::mpsc::Sender; use std::sync::Mutex; use std::thread::JoinHandle; use std::time::Duration; -use crate::progress::ProgressCallback; static MAIN_THREAD_HANDLE: Mutex<Option<JoinHandle<()>>> = Mutex::new(None); @@ -293,12 +293,16 @@ impl Session { /// println!("{}/{}", progress, total); /// true /// }; - /// + /// /// let bv = headless_session /// .load_with_progress("cat.bndb", print_progress) /// .expect("Couldn't open `cat.bndb`"); /// ``` - pub fn load_with_progress(&self, file_path: impl AsRef<Path>, progress: impl ProgressCallback) -> Option<Ref<binary_view::BinaryView>> { + pub fn load_with_progress( + &self, + file_path: impl AsRef<Path>, + progress: impl ProgressCallback, + ) -> Option<Ref<binary_view::BinaryView>> { crate::load_with_progress(file_path, progress) } @@ -333,7 +337,7 @@ impl Session { /// println!("{}/{}", progress, total); /// true /// }; - /// + /// /// let settings: Ref<Metadata> = /// HashMap::from([("analysis.linearSweep.autorun", false.into())]).into(); /// let headless_session = binaryninja::headless::Session::new().unwrap(); @@ -349,7 +353,12 @@ impl Session { options: Option<O>, progress: impl ProgressCallback, ) -> Option<Ref<binary_view::BinaryView>> { - crate::load_with_options_and_progress(file_path, update_analysis_and_wait, options, progress) + crate::load_with_options_and_progress( + file_path, + update_analysis_and_wait, + options, + progress, + ) } } diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 711448e5..267cf840 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -115,7 +115,7 @@ pub fn load(file_path: impl AsRef<Path>) -> Option<Ref<BinaryView>> { } /// Equivalent to [`load`] but with a progress callback. -/// +/// /// NOTE: The progress callback will _only_ be called when loading BNDBs. pub fn load_with_progress<P: ProgressCallback>( file_path: impl AsRef<Path>, diff --git a/rust/tests/collaboration.rs b/rust/tests/collaboration.rs index 7c2a2aae..56b357e9 100644 --- a/rust/tests/collaboration.rs +++ b/rust/tests/collaboration.rs @@ -1,5 +1,7 @@ use binaryninja::binary_view::BinaryViewExt; -use binaryninja::collaboration::{has_collaboration_support, NoNameChangeset, Remote, RemoteFileType, RemoteProject}; +use binaryninja::collaboration::{ + has_collaboration_support, NoNameChangeset, Remote, RemoteFileType, RemoteProject, +}; use binaryninja::headless::Session; use binaryninja::symbol::{SymbolBuilder, SymbolType}; use rstest::*; |
