File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 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 {
3737 ) $( -> $ret_type: ty) ?
3838 ) ,* $( , ) ?
3939) => {
40+ /// Used to describe which call should be triggered by BinaryNinja.
41+ /// By default all calls are disabled.
42+ ///
43+ /// Used by [CustomDataNotification::register]
4044 #[ derive( Default ) ]
4145 pub struct DataNotificationTriggers {
4246 $( $fun_name: bool , ) *
@@ -75,7 +79,7 @@ macro_rules! trait_handler {
7579 handle. $fun_name( $( $value_calculated) ,* )
7680 }
7781 ) *
78- pub fn register_data_notification<' a, H : CustomDataNotification + ' a>(
82+ fn register_data_notification<' a, H : CustomDataNotification + ' a>(
7983 view: & BinaryView ,
8084 notify: H ,
8185 triggers: DataNotificationTriggers ,
@@ -94,6 +98,20 @@ macro_rules! trait_handler {
9498 }
9599 }
96100
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+ /// ```
97115 pub struct DataNotificationClosure <' a> {
98116 $(
99117 $fun_name: Option <Box <
You can’t perform that action at this time.
0 commit comments