Skip to content

Commit 21796e5

Browse files
committed
[Rust] Add BinaryViewExt::type_libraries
1 parent 8c7f0bc commit 21796e5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rust/src/binary_view.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,6 +2134,12 @@ pub trait BinaryViewExt: BinaryViewBase {
21342134
unsafe { TypeContainer::from_raw(type_container_ptr.unwrap()) }
21352135
}
21362136

2137+
fn type_libraries(&self) -> Array<TypeLibrary> {
2138+
let mut count = 0;
2139+
let result = unsafe { BNGetBinaryViewTypeLibraries(self.as_ref().handle, &mut count) };
2140+
unsafe { Array::new(result, count, ()) }
2141+
}
2142+
21372143
/// Make the contents of a type library available for type/import resolution
21382144
fn add_type_library(&self, library: &TypeLibrary) {
21392145
unsafe { BNAddBinaryViewTypeLibrary(self.as_ref().handle, library.as_raw()) }

0 commit comments

Comments
 (0)