summaryrefslogtreecommitdiff
path: root/rust/src/databuffer.rs
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2021-12-02 04:20:45 -0500
committerKyleMiles <krm504@nyu.edu>2021-12-02 04:25:39 -0500
commit4aeb55836f26dc9614264bb3b3ce48a8ba5122e8 (patch)
tree296cc04b8fd86d4c78db8c38719812fbe6e43659 /rust/src/databuffer.rs
parentbbf4d616ebdec77538832c1353b8e200a1ad9bbf (diff)
Rust API - Add BinaryView::data_variables
Diffstat (limited to 'rust/src/databuffer.rs')
-rw-r--r--rust/src/databuffer.rs8
1 files changed, 6 insertions, 2 deletions
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) })
+ }
+}