Skip to content

Commit 416c803

Browse files
committed
Make some Rust core handles public
This is a requirement if we want rust plugins to expose sane FFIs
1 parent a4e2409 commit 416c803

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

rust/src/basic_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub struct BasicBlock<C: BlockContext> {
112112
}
113113

114114
impl<C: BlockContext> BasicBlock<C> {
115-
pub(crate) unsafe fn from_raw(handle: *mut BNBasicBlock, context: C) -> Self {
115+
pub unsafe fn from_raw(handle: *mut BNBasicBlock, context: C) -> Self {
116116
Self { handle, context }
117117
}
118118

rust/src/function.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pub struct NativeBlock {
134134
}
135135

136136
impl NativeBlock {
137-
pub(crate) fn new() -> Self {
137+
pub fn new() -> Self {
138138
NativeBlock { _priv: () }
139139
}
140140
}
@@ -302,12 +302,12 @@ pub struct Function {
302302
}
303303

304304
impl Function {
305-
pub(crate) unsafe fn from_raw(handle: *mut BNFunction) -> Self {
305+
pub unsafe fn from_raw(handle: *mut BNFunction) -> Self {
306306
debug_assert!(!handle.is_null());
307307
Self { handle }
308308
}
309309

310-
pub(crate) unsafe fn ref_from_raw(handle: *mut BNFunction) -> Ref<Self> {
310+
pub unsafe fn ref_from_raw(handle: *mut BNFunction) -> Ref<Self> {
311311
debug_assert!(!handle.is_null());
312312
Ref::new(Self { handle })
313313
}

rust/src/platform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ macro_rules! cc_func {
7272
}
7373

7474
impl Platform {
75-
pub(crate) unsafe fn from_raw(handle: *mut BNPlatform) -> Self {
75+
pub unsafe fn from_raw(handle: *mut BNPlatform) -> Self {
7676
debug_assert!(!handle.is_null());
7777
Self { handle }
7878
}

rust/src/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<T: RefCountable> Ref<T> {
5555
Self { contents }
5656
}
5757

58-
pub(crate) unsafe fn into_raw(obj: Self) -> T {
58+
pub unsafe fn into_raw(obj: Self) -> T {
5959
let res = ptr::read(&obj.contents);
6060
mem::forget(obj);
6161
res

rust/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl BnString {
7070
}
7171

7272
/// Construct a BnString from an owned const char* allocated by BNAllocString
73-
pub(crate) unsafe fn from_raw(raw: *mut c_char) -> Self {
73+
pub unsafe fn from_raw(raw: *mut c_char) -> Self {
7474
Self { raw }
7575
}
7676

rust/src/symbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl SymbolBuilder {
217217

218218
#[derive(Eq)]
219219
pub struct Symbol {
220-
pub(crate) handle: *mut BNSymbol,
220+
pub handle: *mut BNSymbol,
221221
}
222222

223223
impl Symbol {

rust/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ impl Drop for TypeBuilder {
443443

444444
#[repr(transparent)]
445445
pub struct Type {
446-
pub(crate) handle: *mut BNType,
446+
pub handle: *mut BNType,
447447
}
448448

449449
/// ```no_run

0 commit comments

Comments
 (0)