From 4aeb55836f26dc9614264bb3b3ce48a8ba5122e8 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 2 Dec 2021 04:20:45 -0500 Subject: Rust API - Add BinaryView::data_variables --- rust/src/databuffer.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'rust/src/databuffer.rs') diff --git a/rust/src/databuffer.rs b/rust/src/databuffer.rs index d660f570..2d8af7eb 100644 --- a/rust/src/databuffer.rs +++ b/rust/src/databuffer.rs @@ -17,8 +17,6 @@ use binaryninjacore_sys::*; use std::ptr; use std::slice; -// TODO : DataBuffers are RefCounted objects, this needs to be changed to only return Refs to DataBuffers - pub struct DataBuffer(*mut BNDataBuffer); impl DataBuffer { @@ -69,3 +67,9 @@ impl Drop for DataBuffer { } } } + +impl Clone for DataBuffer { + fn clone(&self) -> Self { + Self::from_raw(unsafe { BNDuplicateDataBuffer(self.0) }) + } +} -- cgit v1.3.1