diff options
| author | Mason Reed <mason@vector35.com> | 2026-02-17 20:16:39 -0800 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-02-23 00:09:44 -0800 |
| commit | 837f8590be80b7c98162e70e4f0c1814b83e9d7b (patch) | |
| tree | c3355c31839acf9cbe3148579be1a0685ddce91f /rust/src | |
| parent | b765ffd736ecbfbb7c19b7e166a021ac46a9eeb8 (diff) | |
[Rust] Misc documentation cleanup
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/file_metadata.rs | 4 | ||||
| -rw-r--r-- | rust/src/types/library.rs | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/rust/src/file_metadata.rs b/rust/src/file_metadata.rs index f6427750..bb783158 100644 --- a/rust/src/file_metadata.rs +++ b/rust/src/file_metadata.rs @@ -122,6 +122,10 @@ impl FileMetadata { /// /// It may not be present if the BNDB was saved without it or cleared via [`FileMetadata::clear_original_file_path`]. /// + /// If this [`FileMetadata`] is a database within a project, it may not have a "consumable" original + /// file path. Instead, this might return the path to the on disk file path of the project file that + /// this database was created from, for projects you should query through [`FileMetadata::project_file`]. + /// /// Only prefer this over [`FileMetadata::file_path`] if you require the original binary location. pub fn original_file_path(&self) -> Option<PathBuf> { let raw_name = unsafe { diff --git a/rust/src/types/library.rs b/rust/src/types/library.rs index 3dd353f7..f6415dc4 100644 --- a/rust/src/types/library.rs +++ b/rust/src/types/library.rs @@ -17,6 +17,8 @@ use std::ptr::NonNull; // Used for doc comments #[allow(unused_imports)] use crate::binary_view::BinaryView; +#[allow(unused_imports)] +use crate::binary_view::BinaryViewExt; // TODO: Introduce a FinalizedTypeLibrary that cannot be mutated, so we do not have APIs that are unusable. @@ -255,7 +257,7 @@ impl TypeLibrary { /// Referenced types will not automatically be added, so make sure to add referenced types to the /// library or use [`TypeLibrary::add_type_source`] to mark the references originating source. /// - /// To add objects from a binary view, prefer using [`BinaryView::export_object_to_library`] which + /// To add objects from a binary view, prefer using [`BinaryViewExt::export_object_to_library`] which /// will automatically pull in all referenced types and record additional dependencies as needed. pub fn add_named_object(&self, name: QualifiedName, type_: &Type) { let mut raw_name = QualifiedName::into_raw(name); @@ -274,7 +276,7 @@ impl TypeLibrary { /// Referenced types will not automatically be added, so make sure to add referenced types to the /// library or use [`TypeLibrary::add_type_source`] to mark the references originating source. /// - /// To add types from a binary view, prefer using [`BinaryView::export_type_to_library`] which + /// To add types from a binary view, prefer using [`BinaryViewExt::export_type_to_library`] which /// will automatically pull in all referenced types and record additional dependencies as needed. pub fn add_named_type(&self, name: QualifiedName, type_: &Type) { let mut raw_name = QualifiedName::into_raw(name); @@ -314,7 +316,7 @@ impl TypeLibrary { /// Get the object (function) associated with the given name, if any. /// - /// Prefer [`BinaryView::import_type_library_object`] as it will recursively import types required. + /// Prefer [`BinaryViewExt::import_type_library_object`] as it will recursively import types required. pub fn get_named_object(&self, name: QualifiedName) -> Option<Ref<Type>> { let mut raw_name = QualifiedName::into_raw(name); let t = unsafe { BNGetTypeLibraryNamedObject(self.as_raw(), &mut raw_name) }; @@ -324,7 +326,7 @@ impl TypeLibrary { /// Get the type associated with the given name, if any. /// - /// Prefer [`BinaryView::import_type_library_type`] as it will recursively import types required. + /// Prefer [`BinaryViewExt::import_type_library_type`] as it will recursively import types required. pub fn get_named_type(&self, name: QualifiedName) -> Option<Ref<Type>> { let mut raw_name = QualifiedName::into_raw(name); let t = unsafe { BNGetTypeLibraryNamedType(self.as_raw(), &mut raw_name) }; |
