pub struct DataNotificationClosure<'a> { /* private fields */ }Expand description
Implement closures that will be called by on the event of data modification.
Once dropped the closures will stop being called.
NOTE: Closures are not executed on the same thread as the event that occurred, you must not depend on any serial behavior
§Example
let custom = DataNotificationClosure::default()
.function_updated(|_bv: &BinaryView, _func: &Function| todo!() )
// other calls should be added here
.register(&bv);Implementations§
source§impl<'a> DataNotificationClosure<'a>
impl<'a> DataNotificationClosure<'a>
pub fn new() -> Self
pub fn notification_barrier<F: FnMut(&BinaryView) -> u64 + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn data_written<F: FnMut(&BinaryView, u64, usize) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn data_inserted<F: FnMut(&BinaryView, u64, usize) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn data_removed<F: FnMut(&BinaryView, u64, u64) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn function_added<F: FnMut(&BinaryView, &Function) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn function_removed<F: FnMut(&BinaryView, &Function) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn function_updated<F: FnMut(&BinaryView, &Function) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn function_update_requested<F: FnMut(&BinaryView, &Function) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn data_variable_added<F: FnMut(&BinaryView, &DataVariable) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn data_variable_removed<F: FnMut(&BinaryView, &DataVariable) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn data_variable_updated<F: FnMut(&BinaryView, &DataVariable) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn data_metadata_updated<F: FnMut(&BinaryView, u64) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn tag_type_updated<F: FnMut(&BinaryView, &TagType) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn tag_added<F: FnMut(&BinaryView, &TagReference) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn tag_removed<F: FnMut(&BinaryView, &TagReference) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn tag_updated<F: FnMut(&BinaryView, &TagReference) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn symbol_added<F: FnMut(&BinaryView, &Symbol) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn symbol_removed<F: FnMut(&BinaryView, &Symbol) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn symbol_updated<F: FnMut(&BinaryView, &Symbol) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn string_found<F: FnMut(&BinaryView, StringType, u64, usize) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn string_removed<F: FnMut(&BinaryView, StringType, u64, usize) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn type_defined<F: FnMut(&BinaryView, &QualifiedName, &Type) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn type_undefined<F: FnMut(&BinaryView, &QualifiedName, &Type) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn type_reference_changed<F: FnMut(&BinaryView, &QualifiedName, &Type) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn type_field_reference_changed<F: FnMut(&BinaryView, &QualifiedName, u64) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn segment_added<F: FnMut(&BinaryView, &Segment) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn segment_removed<F: FnMut(&BinaryView, &Segment) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn segment_updated<F: FnMut(&BinaryView, &Segment) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn section_added<F: FnMut(&BinaryView, &Section) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn section_removed<F: FnMut(&BinaryView, &Section) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn section_updated<F: FnMut(&BinaryView, &Section) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn component_name_updated<F: FnMut(&BinaryView, &str, &Component) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn component_added<F: FnMut(&BinaryView, &Component) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn component_moved<F: FnMut(&BinaryView, &Component, &Component, &Component) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn component_removed<F: FnMut(&BinaryView, &Component, &Component) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn component_function_added<F: FnMut(&BinaryView, &Component, &Function) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn component_function_removed<F: FnMut(&BinaryView, &Component, &Function) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn component_data_variable_added<F: FnMut(&BinaryView, &Component, &DataVariable) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn component_data_variable_removed<F: FnMut(&BinaryView, &Component, &DataVariable) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn external_library_added<F: FnMut(&BinaryView, &ExternalLibrary) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn external_library_updated<F: FnMut(&BinaryView, &ExternalLibrary) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn external_library_removed<F: FnMut(&BinaryView, &ExternalLibrary) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn external_location_added<F: FnMut(&BinaryView, &ExternalLocation) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn external_location_updated<F: FnMut(&BinaryView, &ExternalLocation) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn external_location_removed<F: FnMut(&BinaryView, &ExternalLocation) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn type_archive_attached<F: FnMut(&BinaryView, &str, &[u8]) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn type_archive_detached<F: FnMut(&BinaryView, &str, &[u8]) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn type_archive_connected<F: FnMut(&BinaryView, &TypeArchive) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn type_archive_disconnected<F: FnMut(&BinaryView, &TypeArchive) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn undo_entry_added<F: FnMut(&BinaryView, &UndoEntry) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn undo_entry_taken<F: FnMut(&BinaryView, &UndoEntry) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn redo_entry_taken<F: FnMut(&BinaryView, &UndoEntry) + Sync + Send + 'a>( self, param: F, ) -> Self
pub fn rebased<F: FnMut(&BinaryView, &BinaryView) + Sync + Send + 'a>( self, param: F, ) -> Self
sourcepub fn register(self, view: &BinaryView) -> DataNotificationHandle<'a, Self>
pub fn register(self, view: &BinaryView) -> DataNotificationHandle<'a, Self>
Register the closures to be notified up until the DataNotificationHandle is dropped.
Trait Implementations§
source§impl CustomDataNotification for DataNotificationClosure<'_>
impl CustomDataNotification for DataNotificationClosure<'_>
fn notification_barrier(&mut self, view: &BinaryView) -> u64
fn data_written(&mut self, view: &BinaryView, offset: u64, len: usize)
fn data_inserted(&mut self, view: &BinaryView, offset: u64, len: usize)
fn data_removed(&mut self, view: &BinaryView, offset: u64, len: u64)
fn function_added(&mut self, view: &BinaryView, func: &Function)
fn function_removed(&mut self, view: &BinaryView, func: &Function)
fn function_updated(&mut self, view: &BinaryView, func: &Function)
fn function_update_requested(&mut self, view: &BinaryView, func: &Function)
fn data_variable_added(&mut self, view: &BinaryView, var: &DataVariable)
fn data_variable_removed(&mut self, view: &BinaryView, var: &DataVariable)
fn data_variable_updated(&mut self, view: &BinaryView, var: &DataVariable)
fn data_metadata_updated(&mut self, view: &BinaryView, offset: u64)
fn tag_type_updated(&mut self, view: &BinaryView, tag_type: &TagType)
fn tag_added(&mut self, view: &BinaryView, tag_ref: &TagReference)
fn tag_removed(&mut self, view: &BinaryView, tag_ref: &TagReference)
fn tag_updated(&mut self, view: &BinaryView, tag_ref: &TagReference)
fn symbol_added(&mut self, view: &BinaryView, sym: &Symbol)
fn symbol_removed(&mut self, view: &BinaryView, sym: &Symbol)
fn symbol_updated(&mut self, view: &BinaryView, sym: &Symbol)
fn string_found( &mut self, view: &BinaryView, type_: StringType, offset: u64, len: usize, )
fn string_removed( &mut self, view: &BinaryView, type_: StringType, offset: u64, len: usize, )
fn type_defined( &mut self, view: &BinaryView, name: &QualifiedName, type_: &Type, )
fn type_undefined( &mut self, view: &BinaryView, name: &QualifiedName, type_: &Type, )
fn type_reference_changed( &mut self, view: &BinaryView, name: &QualifiedName, type_: &Type, )
fn type_field_reference_changed( &mut self, view: &BinaryView, name: &QualifiedName, offset: u64, )
fn segment_added(&mut self, view: &BinaryView, segment: &Segment)
fn segment_removed(&mut self, view: &BinaryView, segment: &Segment)
fn segment_updated(&mut self, view: &BinaryView, segment: &Segment)
fn section_added(&mut self, view: &BinaryView, section: &Section)
fn section_removed(&mut self, view: &BinaryView, section: &Section)
fn section_updated(&mut self, view: &BinaryView, section: &Section)
fn component_name_updated( &mut self, view: &BinaryView, previous_name: &str, component: &Component, )
fn component_added(&mut self, view: &BinaryView, component: &Component)
fn component_moved( &mut self, view: &BinaryView, former_parent: &Component, new_parent: &Component, component: &Component, )
fn component_removed( &mut self, view: &BinaryView, former_parent: &Component, component: &Component, )
fn component_function_added( &mut self, view: &BinaryView, component: &Component, function: &Function, )
fn component_function_removed( &mut self, view: &BinaryView, component: &Component, function: &Function, )
fn component_data_variable_added( &mut self, view: &BinaryView, component: &Component, var: &DataVariable, )
fn component_data_variable_removed( &mut self, view: &BinaryView, component: &Component, var: &DataVariable, )
fn external_library_added( &mut self, data: &BinaryView, library: &ExternalLibrary, )
fn external_library_updated( &mut self, data: &BinaryView, library: &ExternalLibrary, )
fn external_library_removed( &mut self, data: &BinaryView, library: &ExternalLibrary, )
fn external_location_added( &mut self, data: &BinaryView, location: &ExternalLocation, )
fn external_location_updated( &mut self, data: &BinaryView, location: &ExternalLocation, )
fn external_location_removed( &mut self, data: &BinaryView, location: &ExternalLocation, )
fn type_archive_attached(&mut self, view: &BinaryView, id: &str, path: &[u8])
fn type_archive_detached(&mut self, view: &BinaryView, id: &str, path: &[u8])
fn type_archive_connected(&mut self, view: &BinaryView, archive: &TypeArchive)
fn type_archive_disconnected( &mut self, view: &BinaryView, archive: &TypeArchive, )
fn undo_entry_added(&mut self, view: &BinaryView, entry: &UndoEntry)
fn undo_entry_taken(&mut self, view: &BinaryView, entry: &UndoEntry)
fn redo_entry_taken(&mut self, view: &BinaryView, entry: &UndoEntry)
fn rebased(&mut self, oldview: &BinaryView, newview: &BinaryView)
fn register<'a>(
self,
view: &BinaryView,
triggers: DataNotificationTriggers,
) -> DataNotificationHandle<'a, Self>where
Self: 'a + Sized,
Auto Trait Implementations§
impl<'a> Freeze for DataNotificationClosure<'a>
impl<'a> !RefUnwindSafe for DataNotificationClosure<'a>
impl<'a> Send for DataNotificationClosure<'a>
impl<'a> Sync for DataNotificationClosure<'a>
impl<'a> Unpin for DataNotificationClosure<'a>
impl<'a> !UnwindSafe for DataNotificationClosure<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more