#[repr(C)]pub struct ControllerVTable {
pub prepare: Option<unsafe extern "C" fn(request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>>,
pub create: Option<unsafe extern "C" fn(host: *const ControllerHostVTable, ctx: *const ControllerHostContext, config_json: BorrowedStr<'_>) -> *mut PluginControllerHandle>,
pub drop_handle: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle)>,
pub type_name: Option<unsafe extern "C" fn() -> BorrowedStr<'static>>,
pub on_start: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>,
pub on_stop: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>,
pub on_resume: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>,
pub on_reset: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>,
pub on_dispose: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>,
pub on_degrade: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>,
pub on_fault: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>,
pub on_time_event: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle, event: *const TimeEvent) -> PluginResult<()>>,
}Expand description
Function table for a single plug-in controller type.
Slots are nullable at the ABI type level so the host can reject malformed manifests with null callbacks before constructing a controller. Generated vtables fill every required slot.
Fields§
§prepare: Option<unsafe extern "C" fn(request_json: BorrowedStr<'_>) -> PluginResult<OwnedBytes>>Prepares a controller request before the host registers runtime state.
create: Option<unsafe extern "C" fn(host: *const ControllerHostVTable, ctx: *const ControllerHostContext, config_json: BorrowedStr<'_>) -> *mut PluginControllerHandle>Constructs a fresh controller instance bound to the supplied host vtable and instance context.
drop_handle: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle)>Drops the controller instance and releases all of its resources.
type_name: Option<unsafe extern "C" fn() -> BorrowedStr<'static>>Returns the canonical type name for this controller.
on_start: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>§on_stop: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>§on_resume: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>§on_reset: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>§on_dispose: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>§on_degrade: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>§on_fault: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle) -> PluginResult<()>>§on_time_event: Option<unsafe extern "C" fn(handle: *mut PluginControllerHandle, event: *const TimeEvent) -> PluginResult<()>>Auto Trait Implementations§
impl Freeze for ControllerVTable
impl RefUnwindSafe for ControllerVTable
impl Send for ControllerVTable
impl Sync for ControllerVTable
impl Unpin for ControllerVTable
impl UnsafeUnpin for ControllerVTable
impl UnwindSafe for ControllerVTable
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