pub trait ExecutionHooks {
Show 13 methods
// Provided methods
fn on_context_created(&mut self) { ... }
fn on_request_starting(&mut self) { ... }
fn on_request_started(&mut self) { ... }
fn on_script_executing(&mut self, script_path: &Path) { ... }
fn on_script_executed(&mut self, success: bool) { ... }
fn on_output(&mut self, data: &[u8]) -> OutputAction { ... }
fn on_flush(&mut self) { ... }
fn on_header(&mut self, name: &str, value: &str) -> bool { ... }
fn on_status(&mut self, code: u16) { ... }
fn on_php_message(&mut self, message: &ExecutionMessage) { ... }
fn is_connection_alive(&self) -> bool { ... }
fn on_request_finishing(&mut self) { ... }
fn on_request_finished(&mut self, result: &ExecutionResult) { ... }
}Expand description
Callbacks invoked during PHP request execution.
Default implementations allow for selective participation. Method names are purposefully self-explanatory/self-documenting.
Provided Methods§
Sourcefn on_context_created(&mut self)
fn on_context_created(&mut self)
Called after [ServerContext] is created.
fn on_request_starting(&mut self)
fn on_request_started(&mut self)
Sourcefn on_script_executing(&mut self, script_path: &Path)
fn on_script_executing(&mut self, script_path: &Path)
Called before script execution begins.
Sourcefn on_script_executed(&mut self, success: bool)
fn on_script_executed(&mut self, success: bool)
Called after script execution completes.
Sourcefn on_output(&mut self, data: &[u8]) -> OutputAction
fn on_output(&mut self, data: &[u8]) -> OutputAction
Called when PHP writes to its output buffer.
Sourcefn on_header(&mut self, name: &str, value: &str) -> bool
fn on_header(&mut self, name: &str, value: &str) -> bool
Called for each response header. Return false to suppress the header.
Sourcefn on_php_message(&mut self, message: &ExecutionMessage)
fn on_php_message(&mut self, message: &ExecutionMessage)
Called for PHP errors, warnings, and notices.
Sourcefn is_connection_alive(&self) -> bool
fn is_connection_alive(&self) -> bool
Return false to abort execution (e.g., client disconnected).
Sourcefn on_request_finishing(&mut self)
fn on_request_finishing(&mut self)
Called before php_request_shutdown.
Sourcefn on_request_finished(&mut self, result: &ExecutionResult)
fn on_request_finished(&mut self, result: &ExecutionResult)
Called after request completes with the final result.