diff options
| author | Mason Reed <mason@vector35.com> | 2025-01-31 13:11:41 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-07-02 01:56:53 -0400 |
| commit | f8aaf21991c2a5adcdca56f3638f321b2ccbe809 (patch) | |
| tree | 12f9b3c164e6d71cd26fc97c11f160fc0363ed6b | |
| parent | 4889870837219897480070354656984723887637 (diff) | |
[Rust] Make some core handles public
This is a requirement if we want rust plugins to expose sane FFIs
| -rw-r--r-- | rust/src/basic_block.rs | 2 | ||||
| -rw-r--r-- | rust/src/function.rs | 6 | ||||
| -rw-r--r-- | rust/src/platform.rs | 2 | ||||
| -rw-r--r-- | rust/src/rc.rs | 2 | ||||
| -rw-r--r-- | rust/src/symbol.rs | 2 | ||||
| -rw-r--r-- | rust/src/types.rs | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/rust/src/basic_block.rs b/rust/src/basic_block.rs index 67b85987..3e21094a 100644 --- a/rust/src/basic_block.rs +++ b/rust/src/basic_block.rs @@ -112,7 +112,7 @@ pub struct BasicBlock<C: BlockContext> { } impl<C: BlockContext> BasicBlock<C> { - pub(crate) unsafe fn from_raw(handle: *mut BNBasicBlock, context: C) -> Self { + pub unsafe fn from_raw(handle: *mut BNBasicBlock, context: C) -> Self { Self { handle, context } } diff --git a/rust/src/function.rs b/rust/src/function.rs index 1c2bb21b..d126db3b 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -137,7 +137,7 @@ pub struct NativeBlock { } impl NativeBlock { - pub(crate) fn new() -> Self { + pub fn new() -> Self { NativeBlock { _priv: () } } } @@ -305,12 +305,12 @@ pub struct Function { } impl Function { - pub(crate) unsafe fn from_raw(handle: *mut BNFunction) -> Self { + pub unsafe fn from_raw(handle: *mut BNFunction) -> Self { debug_assert!(!handle.is_null()); Self { handle } } - pub(crate) unsafe fn ref_from_raw(handle: *mut BNFunction) -> Ref<Self> { + pub unsafe fn ref_from_raw(handle: *mut BNFunction) -> Ref<Self> { debug_assert!(!handle.is_null()); Ref::new(Self { handle }) } diff --git a/rust/src/platform.rs b/rust/src/platform.rs index 1bbdef4e..609f4edc 100644 --- a/rust/src/platform.rs +++ b/rust/src/platform.rs @@ -72,7 +72,7 @@ macro_rules! cc_func { } impl Platform { - pub(crate) unsafe fn from_raw(handle: *mut BNPlatform) -> Self { + pub unsafe fn from_raw(handle: *mut BNPlatform) -> Self { debug_assert!(!handle.is_null()); Self { handle } } diff --git a/rust/src/rc.rs b/rust/src/rc.rs index 84168876..f6abb036 100644 --- a/rust/src/rc.rs +++ b/rust/src/rc.rs @@ -55,7 +55,7 @@ impl<T: RefCountable> Ref<T> { Self { contents } } - pub(crate) unsafe fn into_raw(obj: Self) -> T { + pub unsafe fn into_raw(obj: Self) -> T { let res = ptr::read(&obj.contents); mem::forget(obj); res diff --git a/rust/src/symbol.rs b/rust/src/symbol.rs index b06a0f2f..094aeba7 100644 --- a/rust/src/symbol.rs +++ b/rust/src/symbol.rs @@ -217,7 +217,7 @@ impl SymbolBuilder { #[derive(Eq)] pub struct Symbol { - pub(crate) handle: *mut BNSymbol, + pub handle: *mut BNSymbol, } impl Symbol { diff --git a/rust/src/types.rs b/rust/src/types.rs index 7fdbe0c6..03e2fc2c 100644 --- a/rust/src/types.rs +++ b/rust/src/types.rs @@ -431,7 +431,7 @@ impl Drop for TypeBuilder { #[repr(transparent)] pub struct Type { - pub(crate) handle: *mut BNType, + pub handle: *mut BNType, } /// ```no_run |
