Skip to main content

ControllerVTable

Struct ControllerVTable 

Source
#[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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.