diff options
| author | Mason Reed <mason@vector35.com> | 2025-02-25 15:53:32 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-02-25 15:53:32 -0500 |
| commit | b35c5776891075c6c67a8adcb19048baf87de38f (patch) | |
| tree | b357d49032c8fdd97b2a38af99509388d87d8361 /rust/src/custom_binary_view.rs | |
| parent | f4dd84641f5499abee06570e65272698c05a7fb6 (diff) | |
Make `register_platform_recognizer` return by ref in Rust API
Diffstat (limited to 'rust/src/custom_binary_view.rs')
| -rw-r--r-- | rust/src/custom_binary_view.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/src/custom_binary_view.rs b/rust/src/custom_binary_view.rs index 42ebb8da..eb95acb2 100644 --- a/rust/src/custom_binary_view.rs +++ b/rust/src/custom_binary_view.rs @@ -258,12 +258,12 @@ pub trait BinaryViewTypeExt: BinaryViewTypeBase { /// Support for this API tentatively requires explicit support in the [`BinaryView`] implementation. fn register_platform_recognizer<R>(&self, id: u32, endian: Endianness, recognizer: R) where - R: 'static + Fn(&BinaryView, &Metadata) -> Option<Platform> + Send + Sync, + R: 'static + Fn(&BinaryView, &Metadata) -> Option<Ref<Platform>> + Send + Sync, { #[repr(C)] struct PlatformRecognizerHandlerContext<R> where - R: 'static + Fn(&BinaryView, &Metadata) -> Option<Platform> + Send + Sync, + R: 'static + Fn(&BinaryView, &Metadata) -> Option<Ref<Platform>> + Send + Sync, { recognizer: R, } @@ -274,7 +274,7 @@ pub trait BinaryViewTypeExt: BinaryViewTypeBase { metadata: *mut BNMetadata, ) -> *mut BNPlatform where - R: 'static + Fn(&BinaryView, &Metadata) -> Option<Platform> + Send + Sync, + R: 'static + Fn(&BinaryView, &Metadata) -> Option<Ref<Platform>> + Send + Sync, { let context = unsafe { &*(ctxt as *mut PlatformRecognizerHandlerContext<R>) }; let bv = unsafe { BinaryView::from_raw(bv).to_owned() }; |
