From 619376a90c644e264c7b2930593b6116b0ed25a2 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 22 Jun 2025 18:58:10 -0400 Subject: [Rust] Add some additional impls for ergonomics --- rust/src/background_task.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rust/src/background_task.rs') 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 { Ref::new(Self { -- cgit v1.3.1