pub struct PhpBridgeGenerator {
pub core_import: String,
pub type_paths: HashMap<String, String>,
pub error_type: String,
}Expand description
PHP-specific trait bridge generator. Implements code generation for bridging PHP objects to Rust traits.
Fields§
§core_import: StringCore crate import path (e.g., "kreuzberg").
type_paths: HashMap<String, String>Map of type name → fully-qualified Rust path for type references.
error_type: StringError type name (e.g., "KreuzbergError").
Trait Implementations§
Source§impl TraitBridgeGenerator for PhpBridgeGenerator
impl TraitBridgeGenerator for PhpBridgeGenerator
Source§fn foreign_object_type(&self) -> &str
fn foreign_object_type(&self) -> &str
The type of the wrapped foreign object (e.g.,
"Py<PyAny>", "ThreadsafeFunction").Source§fn bridge_imports(&self) -> Vec<String>
fn bridge_imports(&self) -> Vec<String>
Additional
use imports needed for the bridge code.Source§fn gen_sync_method_body(
&self,
method: &MethodDef,
_spec: &TraitBridgeSpec<'_>,
) -> String
fn gen_sync_method_body( &self, method: &MethodDef, _spec: &TraitBridgeSpec<'_>, ) -> String
Generate the body of a synchronous method bridge. Read more
Source§fn gen_async_method_body(
&self,
method: &MethodDef,
spec: &TraitBridgeSpec<'_>,
) -> String
fn gen_async_method_body( &self, method: &MethodDef, spec: &TraitBridgeSpec<'_>, ) -> String
Generate the body of an async method bridge. Read more
Source§fn gen_constructor(&self, spec: &TraitBridgeSpec<'_>) -> String
fn gen_constructor(&self, spec: &TraitBridgeSpec<'_>) -> String
Generate the constructor body that validates and wraps the foreign object. Read more
Source§fn gen_unregistration_fn(&self, spec: &TraitBridgeSpec<'_>) -> String
fn gen_unregistration_fn(&self, spec: &TraitBridgeSpec<'_>) -> String
Generate an unregistration function for the bridge. Read more
Source§fn gen_clear_fn(&self, spec: &TraitBridgeSpec<'_>) -> String
fn gen_clear_fn(&self, spec: &TraitBridgeSpec<'_>) -> String
Generate a clear-all-plugins function for the bridge. Read more
Source§fn gen_registration_fn(&self, spec: &TraitBridgeSpec<'_>) -> String
fn gen_registration_fn(&self, spec: &TraitBridgeSpec<'_>) -> String
Generate the complete registration function including attributes, signature, and body. Read more
Source§fn async_trait_is_send(&self) -> bool
fn async_trait_is_send(&self) -> bool
Auto Trait Implementations§
impl Freeze for PhpBridgeGenerator
impl RefUnwindSafe for PhpBridgeGenerator
impl Send for PhpBridgeGenerator
impl Sync for PhpBridgeGenerator
impl Unpin for PhpBridgeGenerator
impl UnsafeUnpin for PhpBridgeGenerator
impl UnwindSafe for PhpBridgeGenerator
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