Expand description
Wraps a Box<dyn Plugin> into the exported foldit_plugin_vtable
symbol the host dlopens.
Marshalling lives in free functions here so it is unit-testable; the
export_plugin! macro only emits the extern "C"
entry points and the static vtable.
Functions§
- assets_
from_ ⚠c - Safety
- buffer_
from_ vec - Hand a
Vec<u8>to the host. Ownership transfers; the host returns it throughfree_buffer, which reconstructs theVecfrom the recorded capacity. - ctx_
from_ ⚠c - Safety
- drop_
buffer ⚠ - Release a buffer previously produced by
buffer_from_vec. - drop_
error ⚠ - Release both inner buffers of an error this plugin allocated.
- encode_
to_ buffer - Encode a prost message into a host-owned buffer.
- guard
- Run plugin code, converting a panic into an error rather than unwinding across the FFI boundary (which is UB).
- params_
from_ ⚠c Unspecifiedentries are dropped: the ABI treats them as “skip”.- poll_
outcome_ to_ proto poll_streamis the one vtable slot whose payload is proto-encoded.- report_
error ⚠ - Populate
out_errand pick the status the host should see.Unsupportedmaps to the dedicated status so the host can distinguish “plugin has no streaming” from “streaming failed”. - slice_
from_ ⚠raw - Safety
- write_
error ⚠ - Safety
Type Aliases§
- Boxed
Plugin - Handle payload behind
crate::abi::FolditPluginHandle: a thin pointer to the boxed trait object (the trait object itself is a fat pointer and cannot be cast to*mut c_voiddirectly).