pub struct NapiBridgeGenerator {
pub core_import: String,
pub type_paths: HashMap<String, String>,
pub error_type: String,
}Expand description
NAPI-specific trait bridge generator. Implements code generation for bridging JavaScript 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 NapiBridgeGenerator
impl TraitBridgeGenerator for NapiBridgeGenerator
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 NapiBridgeGenerator
impl RefUnwindSafe for NapiBridgeGenerator
impl Send for NapiBridgeGenerator
impl Sync for NapiBridgeGenerator
impl Unpin for NapiBridgeGenerator
impl UnsafeUnpin for NapiBridgeGenerator
impl UnwindSafe for NapiBridgeGenerator
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