diff options
| author | Mason Reed <mason@vector35.com> | 2025-06-05 12:31:02 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-06-05 12:31:07 -0400 |
| commit | c03957c2db8ff6c57f154cb27077bbb36e8cca43 (patch) | |
| tree | 2781e8e5343f3319061b886d1c52f7578aa21b5f /rust/src | |
| parent | b9049f1fda24641f08c3ae6029292ba0b1b0dc53 (diff) | |
Fix and add code docs regarding FileMetadata view types vs view names
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/file_metadata.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rust/src/file_metadata.rs b/rust/src/file_metadata.rs index ed859775..6d123373 100644 --- a/rust/src/file_metadata.rs +++ b/rust/src/file_metadata.rs @@ -200,6 +200,15 @@ impl FileMetadata { unsafe { BNGetCurrentOffset(self.handle) } } + /// Navigate to an offset for a specific view. + /// + /// # Example + /// + /// ```no_run + /// use binaryninja::file_metadata::FileMetadata; + /// # let file: FileMetadata = unimplemented!(); + /// file.navigate_to("Linear:Raw", 0x0).expect("Linear:Raw should always be present"); + /// ``` pub fn navigate_to(&self, view: &str, offset: u64) -> Result<(), ()> { let view = view.to_cstr(); @@ -212,6 +221,15 @@ impl FileMetadata { } } + /// Get the [`BinaryView`] for the view type. + /// + /// # Example + /// + /// ```no_run + /// use binaryninja::file_metadata::FileMetadata; + /// # let file: FileMetadata = unimplemented!(); + /// file.view_of_type("Raw").expect("Raw type should always be present"); + /// ``` pub fn view_of_type(&self, view: &str) -> Option<Ref<BinaryView>> { let view = view.to_cstr(); |
