Skip to main content

ZendExtensionHandler

Trait ZendExtensionHandler 

Source
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) { ... }
}
Available on crate feature 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§

Source

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.

Source

fn on_statement(&self, _execute_data: &ExecuteData)

Called for each executed statement. Enabled by ZendExtensionBuilder::hook_statements.

Source

fn on_fcall_begin(&self, _execute_data: &ExecuteData)

Called at the beginning of each function call (legacy hook). Enabled by ZendExtensionBuilder::hook_fcalls.

Source

fn on_fcall_end(&self, _execute_data: &ExecuteData)

Called at the end of each function call (legacy hook). Enabled by ZendExtensionBuilder::hook_fcalls.

Source

fn on_op_array_ctor(&self, _op_array: &mut zend_op_array)

Called when a new op_array is constructed.

Source

fn on_op_array_dtor(&self, _op_array: &mut zend_op_array)

Called when an op_array is destroyed.

Source

fn on_message(&self, _message: i32, _arg: *mut c_void)

Called when another zend_extension sends a message.

Source

fn on_activate(&self)

Per-request activation (distinct from RINIT).

Source

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".

Implementors§