File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ macro_rules! trait_handler {
37
37
) $( -> $ret_type: ty) ?
38
38
) ,* $( , ) ?
39
39
) => {
40
+ /// Used to describe which call should be triggered by BinaryNinja.
41
+ /// By default all calls are disabled.
42
+ ///
43
+ /// Used by [CustomDataNotification::register]
40
44
#[ derive( Default ) ]
41
45
pub struct DataNotificationTriggers {
42
46
$( $fun_name: bool , ) *
@@ -75,7 +79,7 @@ macro_rules! trait_handler {
75
79
handle. $fun_name( $( $value_calculated) ,* )
76
80
}
77
81
) *
78
- pub fn register_data_notification<' a, H : CustomDataNotification + ' a>(
82
+ fn register_data_notification<' a, H : CustomDataNotification + ' a>(
79
83
view: & BinaryView ,
80
84
notify: H ,
81
85
triggers: DataNotificationTriggers ,
@@ -94,6 +98,20 @@ macro_rules! trait_handler {
94
98
}
95
99
}
96
100
101
+ /// Implement closures that will be called by BinaryNinja on the event of
102
+ /// data modification.
103
+ ///
104
+ /// example:
105
+ /// ```no_run
106
+ /// # use binaryninja::data_notification::DataNotificationClosure;
107
+ /// # use binaryninja::function::Function;
108
+ /// # use binaryninja::binary_view::BinaryView;
109
+ /// # let bv: BinaryView = todo!();
110
+ /// let custom = DataNotificationClosure::default()
111
+ /// .function_updated(|_bv: &BinaryView, _func: &Function| todo!() )
112
+ /// // other calls should be added here
113
+ /// .register(&bv);
114
+ /// ```
97
115
pub struct DataNotificationClosure <' a> {
98
116
$(
99
117
$fun_name: Option <Box <
You can’t perform that action at this time.
0 commit comments