#[repr(C)]pub struct CortexPluginApi {
pub abi_version: u32,
pub plugin: *mut c_void,
pub plugin_info: Option<unsafe extern "C" fn(*mut c_void) -> CortexBuffer>,
pub tool_count: Option<unsafe extern "C" fn(*mut c_void) -> usize>,
pub tool_descriptor: Option<unsafe extern "C" fn(*mut c_void, usize) -> CortexBuffer>,
pub tool_execute: Option<unsafe extern "C" fn(*mut c_void, CortexBuffer, CortexBuffer, CortexBuffer) -> CortexBuffer>,
pub plugin_drop: Option<unsafe extern "C" fn(*mut c_void)>,
pub buffer_free: Option<unsafe extern "C" fn(CortexBuffer)>,
}Expand description
Function table exported by a native plugin.
Fields§
§abi_version: u32Plugin-supported native ABI version.
plugin: *mut c_voidOpaque plugin state owned by the plugin.
plugin_info: Option<unsafe extern "C" fn(*mut c_void) -> CortexBuffer>Return PluginInfo encoded as JSON.
tool_count: Option<unsafe extern "C" fn(*mut c_void) -> usize>Return the number of tools exposed by the plugin.
tool_descriptor: Option<unsafe extern "C" fn(*mut c_void, usize) -> CortexBuffer>Return one tool descriptor encoded as JSON.
tool_execute: Option<unsafe extern "C" fn(*mut c_void, CortexBuffer, CortexBuffer, CortexBuffer) -> CortexBuffer>Execute a tool. The name, input, and invocation context are UTF-8 JSON
buffers except tool_name, which is a UTF-8 string.
plugin_drop: Option<unsafe extern "C" fn(*mut c_void)>Drop plugin-owned state.
buffer_free: Option<unsafe extern "C" fn(CortexBuffer)>Free buffers returned by plugin functions.
Implementations§
Auto Trait Implementations§
impl Freeze for CortexPluginApi
impl RefUnwindSafe for CortexPluginApi
impl !Send for CortexPluginApi
impl !Sync for CortexPluginApi
impl Unpin for CortexPluginApi
impl UnsafeUnpin for CortexPluginApi
impl UnwindSafe for CortexPluginApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more