From ca0e32efb1e5b9eba157e9fd2eef178d9367c578 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Thu, 11 Dec 2025 14:45:23 -0500 Subject: [Rust] Restructure type APIs into `types` module This helps with documentation, giving a single module for those working with types to find related APIs Also split out enumeration and structure APIs into their own file, since they have their own backing data separate from `Type`. --- rust/tests/type_archive.rs | 3 +-- rust/tests/type_library.rs | 3 +-- rust/tests/type_parser.rs | 3 +-- rust/tests/type_printer.rs | 8 +++----- 4 files changed, 6 insertions(+), 11 deletions(-) (limited to 'rust/tests') diff --git a/rust/tests/type_archive.rs b/rust/tests/type_archive.rs index 12fcec9d..3e13507e 100644 --- a/rust/tests/type_archive.rs +++ b/rust/tests/type_archive.rs @@ -1,7 +1,6 @@ use binaryninja::headless::Session; use binaryninja::platform::Platform; -use binaryninja::type_archive::TypeArchive; -use binaryninja::types::{Type, TypeClass}; +use binaryninja::types::{Type, TypeArchive, TypeClass}; #[test] fn test_create_archive() { diff --git a/rust/tests/type_library.rs b/rust/tests/type_library.rs index 83937386..b8a12870 100644 --- a/rust/tests/type_library.rs +++ b/rust/tests/type_library.rs @@ -1,8 +1,7 @@ use binaryninja::binary_view::BinaryViewExt; use binaryninja::headless::Session; use binaryninja::platform::Platform; -use binaryninja::type_library::TypeLibrary; -use binaryninja::types::{Type, TypeClass}; +use binaryninja::types::{Type, TypeClass, TypeLibrary}; use std::path::PathBuf; #[test] diff --git a/rust/tests/type_parser.rs b/rust/tests/type_parser.rs index d08e7791..64771404 100644 --- a/rust/tests/type_parser.rs +++ b/rust/tests/type_parser.rs @@ -1,7 +1,6 @@ use binaryninja::headless::Session; use binaryninja::platform::Platform; -use binaryninja::type_parser::{CoreTypeParser, TypeParser, TypeParserError}; -use binaryninja::types::Type; +use binaryninja::types::{CoreTypeParser, Type, TypeParser, TypeParserError}; use binaryninjacore_sys::BNTypeParserErrorSeverity::ErrorSeverity; const TEST_TYPES: &str = r#" diff --git a/rust/tests/type_printer.rs b/rust/tests/type_printer.rs index 4ff67232..67035376 100644 --- a/rust/tests/type_printer.rs +++ b/rust/tests/type_printer.rs @@ -3,12 +3,10 @@ use binaryninja::disassembly::InstructionTextToken; use binaryninja::headless::Session; use binaryninja::platform::Platform; use binaryninja::rc::Ref; -use binaryninja::type_container::TypeContainer; -use binaryninja::type_printer::{ - register_type_printer, CoreTypePrinter, TokenEscapingType, TypeDefinitionLine, TypePrinter, -}; +use binaryninja::types::printer::{register_type_printer, TokenEscapingType, TypeDefinitionLine}; use binaryninja::types::{ - MemberAccess, MemberScope, QualifiedName, Structure, StructureMember, Type, + CoreTypePrinter, MemberAccess, MemberScope, QualifiedName, Structure, StructureMember, Type, + TypeContainer, TypePrinter, }; use std::path::PathBuf; -- cgit v1.3.1