diff options
| author | Mason Reed <mason@vector35.com> | 2026-04-21 18:10:51 -0700 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-05-10 17:13:08 -0700 |
| commit | c4ba6d79ae3b96d56cc6b3744e7c64e004ecd161 (patch) | |
| tree | 5762fc3ff58b57caec5f42176faf6635c464b4f3 /rust/src/collaboration | |
| parent | 8269a8ac29e59c7949af753dac5c1f36bb700903 (diff) | |
[Rust] Refactor `binary_view` module
- Remove the "viral" `BinaryViewExt` trait and its blanket impl
- Split up the binary view type from the custom trait impl
- Simplify and fix bugs regarding custom binary view initialization
- Rewrite Minidump binary view example, parses the PE headers to create proper sections now
- Add some extra documentation
- Add unit test for custom binary view
Diffstat (limited to 'rust/src/collaboration')
| -rw-r--r-- | rust/src/collaboration/file.rs | 2 | ||||
| -rw-r--r-- | rust/src/collaboration/project.rs | 5 | ||||
| -rw-r--r-- | rust/src/collaboration/snapshot.rs | 2 | ||||
| -rw-r--r-- | rust/src/collaboration/sync.rs | 4 |
4 files changed, 6 insertions, 7 deletions
diff --git a/rust/src/collaboration/file.rs b/rust/src/collaboration/file.rs index dbe2b8b9..84860dd8 100644 --- a/rust/src/collaboration/file.rs +++ b/rust/src/collaboration/file.rs @@ -11,7 +11,7 @@ use super::{ Remote, RemoteFolder, RemoteProject, RemoteSnapshot, }; -use crate::binary_view::{BinaryView, BinaryViewExt}; +use crate::binary_view::BinaryView; use crate::database::Database; use crate::file_metadata::FileMetadata; use crate::progress::{NoProgressCallback, ProgressCallback, SplitProgressBuilder}; diff --git a/rust/src/collaboration/project.rs b/rust/src/collaboration/project.rs index 3a24ea8b..8ee53f6a 100644 --- a/rust/src/collaboration/project.rs +++ b/rust/src/collaboration/project.rs @@ -8,11 +8,10 @@ use binaryninjacore_sys::*; use super::{ sync, CollaborationPermissionLevel, NameChangeset, Permission, Remote, RemoteFile, - RemoteFileType, RemoteFolder, + RemoteFileType, RemoteFolder, RemoteUser, }; -use crate::binary_view::{BinaryView, BinaryViewExt}; -use crate::collaboration::RemoteUser; +use crate::binary_view::BinaryView; use crate::database::Database; use crate::file_metadata::FileMetadata; use crate::progress::{NoProgressCallback, ProgressCallback}; diff --git a/rust/src/collaboration/snapshot.rs b/rust/src/collaboration/snapshot.rs index 203d8677..3e99805d 100644 --- a/rust/src/collaboration/snapshot.rs +++ b/rust/src/collaboration/snapshot.rs @@ -3,7 +3,7 @@ use std::ptr::NonNull; use std::time::SystemTime; use super::{sync, Remote, RemoteFile, RemoteProject}; -use crate::binary_view::{BinaryView, BinaryViewExt}; +use crate::binary_view::BinaryView; use crate::collaboration::undo::{RemoteUndoEntry, RemoteUndoEntryId}; use crate::database::snapshot::Snapshot; use crate::progress::{NoProgressCallback, ProgressCallback}; diff --git a/rust/src/collaboration/sync.rs b/rust/src/collaboration/sync.rs index 72c57a46..1bf9c010 100644 --- a/rust/src/collaboration/sync.rs +++ b/rust/src/collaboration/sync.rs @@ -6,7 +6,7 @@ use std::ffi::{c_char, c_void}; use std::path::{Path, PathBuf}; use std::ptr::NonNull; -use crate::binary_view::{BinaryView, BinaryViewExt}; +use crate::binary_view::BinaryView; use crate::database::{snapshot::Snapshot, Database}; use crate::file_metadata::FileMetadata; use crate::progress::{NoProgressCallback, ProgressCallback}; @@ -138,7 +138,7 @@ pub fn get_remote_for_local_database(database: &Database) -> Result<Option<Ref<R .ok_or(()) } -/// Get the Remote for a BinaryView +/// Get the [`Remote`] for the given [`BinaryView`]. pub fn get_remote_for_binary_view(bv: &BinaryView) -> Result<Option<Ref<Remote>>, ()> { let Some(db) = bv.file().database() else { return Ok(None); |
