summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-03-13 12:24:18 -0700
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-03-24 18:46:48 -0700
commit3c88b11e5df33116580ac008e36092775df66135 (patch)
treecd64fbe149f05683ddabcccd0db7b87356f1f8cf /rust/src
parentf325aa7b6026a1daef84931baeb1f50d7da10c10 (diff)
[WARP] Improved UX and API
- Exposes WARP type objects directly - Adds processor API (for generating warp files directly) - Adds file and chunk API - Misc cleanup - Simplified the amount of commands - Replaced the "Create" commands with a purpose built processor dialog - Added a native QT viewer for WARP files - Simplified committing to a remote with a purpose built commit dialog
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/data_buffer.rs7
-rw-r--r--rust/src/project/file.rs2
2 files changed, 8 insertions, 1 deletions
diff --git a/rust/src/data_buffer.rs b/rust/src/data_buffer.rs
index 79b3b20b..f8d71088 100644
--- a/rust/src/data_buffer.rs
+++ b/rust/src/data_buffer.rs
@@ -32,6 +32,13 @@ impl DataBuffer {
self.0
}
+ /// Return the raw pointer to the underlying data buffer, to be freed later with `BNFreeDataBuffer`.
+ pub fn into_raw(self) -> *mut BNDataBuffer {
+ let ptr = self.0;
+ std::mem::forget(self);
+ ptr
+ }
+
pub fn new(data: &[u8]) -> Self {
let buffer = unsafe { BNCreateDataBuffer(data.as_ptr() as *const c_void, data.len()) };
assert!(!buffer.is_null());
diff --git a/rust/src/project/file.rs b/rust/src/project/file.rs
index 22bf9b4b..d016d377 100644
--- a/rust/src/project/file.rs
+++ b/rust/src/project/file.rs
@@ -22,7 +22,7 @@ pub struct ProjectFile {
}
impl ProjectFile {
- pub(crate) unsafe fn from_raw(handle: NonNull<BNProjectFile>) -> Self {
+ pub unsafe fn from_raw(handle: NonNull<BNProjectFile>) -> Self {
Self { handle }
}