#[repr(C)]pub struct Desc {
pub abi_version: u32,
pub struct_size: u32,
pub script_wire_version: u16,
pub flags: u16,
pub reserved: u32,
pub name: *const c_char,
pub version: *const c_char,
pub init: Option<InitFn>,
pub call: Option<HookFn>,
pub shutdown: Option<unsafe extern "C" fn()>,
pub free: Option<FreeFn>,
}Expand description
The descriptor a plugin’s entry function returns. Lives for the process; the host reads it after the handshake below.
abi_version and struct_size sit first and their offsets are frozen
forever: the host reads them before it trusts anything else about the
struct, so a future layout can still be refused with a clear error.
Fields§
§abi_version: u32Must equal ABI_VERSION.
struct_size: u32size_of::<Desc>() on the plugin side; a shorter value than the
host’s own means a truncated or foreign struct.
script_wire_version: u16lumen_script::SCRIPT_WIRE_VERSION the plugin was built against. The
values, commands, and signatures it exchanges are only meaningful when
it matches the host’s.
flags: u16Bit set of FLAG_PANIC_ABORT and future flags; zero otherwise.
reserved: u32Zero. Keeps the pointer fields below 8-aligned on every target.
name: *const c_charNUL-terminated UTF-8, 'static. Must match the name the app declared
the module under.
version: *const c_charNUL-terminated UTF-8, 'static.
init: Option<InitFn>Required. Runs once, before any call.
call: Option<HookFn>Required when the manifest declares functions. input is a bincode
Call, ctx is empty (the plugin already has its
context from init), and out is a bincode
CallOut.
shutdown: Option<unsafe extern "C" fn()>Optional. Runs once, when the app is going down.
free: Option<FreeFn>Required. Frees every buffer the entries above hand out.