Expand description
StreamKit Native Plugin SDK
This SDK provides an ergonomic Rust interface for writing native plugins that use a stable C ABI. While the interface feels like pure Rust, under the hood it generates C-compatible exports for maximum binary compatibility.
§Example
use streamkit_plugin_sdk_native::prelude::*;
pub struct MyPlugin {
// plugin state
}
impl NativeProcessorNode for MyPlugin {
fn metadata() -> NodeMetadata {
NodeMetadata::builder("my_plugin")
.input("in", &[PacketType::Any])
.output("out", PacketType::Any)
.build()
}
fn new(_params: Option<serde_json::Value>, _logger: Logger) -> Result<Self, String> {
Ok(Self {})
}
fn process(
&mut self,
_pin: &str,
packet: Packet,
output: &OutputSender,
) -> Result<(), String> {
output.send("out", &packet)?;
Ok(())
}
}
native_plugin_entry!(MyPlugin);Re-exports§
pub use streamkit_core;pub use types::*;
Modules§
- conversions
- Type conversions between C ABI types and Rust types
- logger
- Logging utilities for native plugins
- prelude
- Re-export commonly used types
- types
- C ABI types for native plugins
Macros§
- native_
plugin_ entry - Macro to generate C ABI exports for a plugin
- plugin_
debug - plugin_
error - plugin_
info - plugin_
log - Helper macros for logging with tracing-style field syntax support
- plugin_
trace - plugin_
warn
Structs§
- Node
Metadata - Metadata about a node type
- Node
Metadata Builder - Builder for NodeMetadata
- Output
Sender - Output sender for sending packets to output pins
Traits§
- Native
Processor Node - Trait that plugin authors implement This provides an ergonomic Rust interface that gets wrapped with C ABI exports
- Resource
Support - Optional trait for plugins that need shared resource management (e.g., ML models).