pub trait ZendExtensionHandler:
Send
+ Sync
+ 'static {
// Provided methods
fn on_op_array_compiled(&self, _op_array: &mut zend_op_array) { ... }
fn on_statement(&self, _execute_data: &ExecuteData) { ... }
fn on_fcall_begin(&self, _execute_data: &ExecuteData) { ... }
fn on_fcall_end(&self, _execute_data: &ExecuteData) { ... }
fn on_op_array_ctor(&self, _op_array: &mut zend_op_array) { ... }
fn on_op_array_dtor(&self, _op_array: &mut zend_op_array) { ... }
fn on_message(&self, _message: i32, _arg: *mut c_void) { ... }
fn on_activate(&self) { ... }
fn on_deactivate(&self) { ... }
}observer only.Expand description
Trait for handling low-level Zend Engine hooks via zend_extension.
All methods have default no-op implementations. Override only what you need.
§Thread Safety
Handler must be Send + Sync. Use thread-safe primitives for mutable state.
Provided Methods§
Sourcefn on_op_array_compiled(&self, _op_array: &mut zend_op_array)
fn on_op_array_compiled(&self, _op_array: &mut zend_op_array)
Called after compilation of each function/method op_array.
Enabled by ZendExtensionBuilder::hook_op_array_compile.
Sourcefn on_statement(&self, _execute_data: &ExecuteData)
fn on_statement(&self, _execute_data: &ExecuteData)
Called for each executed statement.
Enabled by ZendExtensionBuilder::hook_statements.
Sourcefn on_fcall_begin(&self, _execute_data: &ExecuteData)
fn on_fcall_begin(&self, _execute_data: &ExecuteData)
Called at the beginning of each function call (legacy hook).
Enabled by ZendExtensionBuilder::hook_fcalls.
Sourcefn on_fcall_end(&self, _execute_data: &ExecuteData)
fn on_fcall_end(&self, _execute_data: &ExecuteData)
Called at the end of each function call (legacy hook).
Enabled by ZendExtensionBuilder::hook_fcalls.
Sourcefn on_op_array_ctor(&self, _op_array: &mut zend_op_array)
fn on_op_array_ctor(&self, _op_array: &mut zend_op_array)
Called when a new op_array is constructed.
Sourcefn on_op_array_dtor(&self, _op_array: &mut zend_op_array)
fn on_op_array_dtor(&self, _op_array: &mut zend_op_array)
Called when an op_array is destroyed.
Sourcefn on_message(&self, _message: i32, _arg: *mut c_void)
fn on_message(&self, _message: i32, _arg: *mut c_void)
Called when another zend_extension sends a message.
Sourcefn on_activate(&self)
fn on_activate(&self)
Per-request activation (distinct from RINIT).
Sourcefn on_deactivate(&self)
fn on_deactivate(&self)
Per-request deactivation (distinct from RSHUTDOWN).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".