Expand description
rustbridge-ffi - C ABI exports and FFI buffer management
This crate provides the FFI boundary layer:
FfiBufferfor passing data across FFIPluginHandlefor managing plugin instances- C ABI exported functions (plugin_init, plugin_call, etc.)
§FFI Functions
The following functions are exported with C linkage:
plugin_init- Initialize a plugin instanceplugin_call- Make a synchronous request to the pluginplugin_free_buffer- Free a buffer returned by plugin_callplugin_shutdown- Shutdown a plugin instanceplugin_set_log_level- Set the log level for a plugin
Modules§
- prelude
- Prelude module for convenient imports
Macros§
- plugin_
entry - Macro to generate the FFI entry point for a plugin
Structs§
- Async
Bridge - Bridge for executing async operations from sync FFI context
- Async
Runtime - Manages the Tokio async runtime for a plugin
- FfiBuffer
- Buffer for passing data across FFI boundary
- Plugin
Config - Plugin configuration passed during initialization
- Plugin
Context - Context provided to plugin operations
- Plugin
Handle - Handle to an initialized plugin instance
- Plugin
Handle Manager - Manages plugin handles
- RbBytes
- FFI-safe borrowed byte slice reference
- RbBytes
Owned - FFI-safe owned byte buffer
- RbResponse
- FFI buffer for binary transport responses
- RbString
- FFI-safe borrowed string reference
- RbString
Owned - FFI-safe owned string
- Request
Envelope - Request envelope wrapping a message for FFI transport
- Response
Envelope - Response envelope wrapping a response for FFI transport
- Runtime
Config - Configuration for the async runtime
Enums§
- LogLevel
- Log levels for FFI callbacks
- Plugin
Error - Error type for plugin operations
Traits§
- Plugin
- Main trait for implementing rustbridge plugins
Functions§
- plugin_
call ⚠ - Make a synchronous call to the plugin
- plugin_
call_ ⚠raw - Make a synchronous binary call to the plugin
- plugin_
free_ ⚠buffer - Free a buffer returned by plugin_call
- plugin_
get_ ⚠rejected_ count - Get the number of requests rejected due to concurrency limits
- plugin_
get_ ⚠state - Get the current state of a plugin
- plugin_
init ⚠ - Initialize a plugin instance
- plugin_
set_ ⚠log_ level - Set the log level for a plugin
- plugin_
shutdown ⚠ - Shutdown a plugin instance
- rb_
response_ ⚠free - Free an RbResponse returned by plugin_call_raw
- register_
binary_ handler - Register a binary message handler
Type Aliases§
- Binary
Message Handler - Handler function type for binary message processing
- LogCallback
- FFI callback function type for logging