From c4ba6d79ae3b96d56cc6b3744e7c64e004ecd161 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 21 Apr 2026 18:10:51 -0700 Subject: [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 --- rust/src/segment.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'rust/src/segment.rs') diff --git a/rust/src/segment.rs b/rust/src/segment.rs index 348d8f67..a042d1fd 100644 --- a/rust/src/segment.rs +++ b/rust/src/segment.rs @@ -41,6 +41,9 @@ impl SegmentBuilder { } } + /// The range of the data in the parent binary view. + /// + /// If this is not specified, then the segment is "unbacked" and will contain no data. pub fn parent_backing(mut self, parent_backing: Range) -> Self { self.parent_backing = Some(parent_backing); self @@ -107,7 +110,6 @@ impl Segment { /// /// ```no_run /// # use binaryninja::segment::{Segment, SegmentFlags}; - /// # use binaryninja::binary_view::BinaryViewExt; /// let bv = binaryninja::load("example").unwrap(); /// let segment_flags = SegmentFlags::new().writable(true).readable(true); /// bv.add_segment(Segment::builder(0..0x1000).flags(segment_flags)) -- cgit v1.3.1