-
Notifications
You must be signed in to change notification settings - Fork 237
Implement DataNotification for rust #6543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
The solution for only registering the notifications is fine with me, I will be able to review this more once testing is done for the upcoming 5.0 release. Thank you! |
When constructing the data notification it is very important that we not copy/clone the binaryninja-api/rust/src/data_notification.rs Lines 92 to 103 in ddad753
|
If I understand your comment correctly, then you are doing a pointer equality check during deregister? In that case a - let mut boxed_handle = Box::new(handle);
+ let mut boxed_handle = Box::pin(handle);
fn register_data_notification<'a, H: CustomDataNotification + 'a>(
view: &BinaryView,
notify: &'a H,
triggers: DataNotificationTriggers,
) -> DataNotificationHandle<'a, H> {}
fn register<'a>(
&'a self,
view: &BinaryView,
triggers: DataNotificationTriggers,
) -> DataNotificationHandle<'a, Self> where Self: 'a + Sized {
register_data_notification(view, self, triggers)
} if you require fn register_data_notification<'a, H: CustomDataNotification + 'a>(
view: &BinaryView,
notify: Pin<&'a H>,
triggers: DataNotificationTriggers,
) -> DataNotificationHandle<'a, H> {}
fn register<'a>(
self: Pin<&'a Self>,
view: &BinaryView,
triggers: DataNotificationTriggers,
) -> DataNotificationHandle<'a, Self> where Self: 'a + Sized {
register_data_notification(view, self, triggers)
} With a few extra lines you could then also support One alternative would be to add support for fetching the original |
No description provided.