pub trait OutputSink:
Send
+ Sync
+ 'static {
// Required method
fn push(&self, bytes: RVec<u8>) -> RResult<(), RString>;
}Expand description
Per-frame output sink for streaming plugins.
Crosses the dlopen boundary like FfiNode. The host hands an
OutputSinkBox to FfiNode::process_streaming; the plugin
invokes push() once per emission, and the host forwards each
blob into its own streaming callback chain (router → next node
→ transport).
push takes &self because every realistic implementation
(tokio mpsc senders, lock-free queues) has interior mutability —
forcing &mut self would just push the synchronisation into the
plugin’s callback closure.
push returns RErr if the host’s receiver was dropped
mid-stream (session shutdown, barge-in). Plugins should treat
that as “consumer is gone, unwind ASAP” rather than retrying.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".