summaryrefslogtreecommitdiff
path: root/rust/src/background_task.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-06-22 18:58:10 -0400
committerMason Reed <mason@vector35.com>2025-07-02 01:56:54 -0400
commit619376a90c644e264c7b2930593b6116b0ed25a2 (patch)
tree24a4628d18bebbc1d61b74e40009d19aa7c5a660 /rust/src/background_task.rs
parente39ce55e4cc232d0d73b20d490c69bb6dd9a88a3 (diff)
[Rust] Add some additional impls for ergonomics
Diffstat (limited to 'rust/src/background_task.rs')
-rw-r--r--rust/src/background_task.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/rust/src/background_task.rs b/rust/src/background_task.rs
index ea1e3b0d..4899df8c 100644
--- a/rust/src/background_task.rs
+++ b/rust/src/background_task.rs
@@ -15,6 +15,7 @@
//! Background tasks provide plugins the ability to inform the core of long-running background tasks.
use binaryninjacore_sys::*;
+use std::fmt::Debug;
use std::result;
@@ -89,6 +90,17 @@ impl BackgroundTask {
}
}
+impl Debug for BackgroundTask {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ f.debug_struct("BackgroundTask")
+ .field("progress_text", &self.progress_text())
+ .field("can_cancel", &self.can_cancel())
+ .field("is_cancelled", &self.is_cancelled())
+ .field("is_finished", &self.is_finished())
+ .finish()
+ }
+}
+
unsafe impl RefCountable for BackgroundTask {
unsafe fn inc_ref(handle: &Self) -> Ref<Self> {
Ref::new(Self {