Skip to main content

Module trait_bridge

Module trait_bridge 

Source
Expand description

PHP (ext-php-rs) specific trait bridge code generation.

Generates Rust wrapper structs that implement Rust traits by delegating to PHP objects via ext-php-rs Zval method calls.

Structs§

PhpBridgeGenerator
PHP-specific trait bridge generator. Implements code generation for bridging PHP objects to Rust traits.

Functions§

find_bridge_param
Find the first parameter index and bridge config where the parameter’s named type matches a trait bridge’s type_alias.
gen_bridge_function
Generate a PHP static method that has one parameter replaced by Option<ext_php_rs::boxed::ZBox<ext_php_rs::types::ZendObject>> (a trait bridge).
gen_trait_bridge
Generate all trait bridge code for a given trait type and bridge config.