Skip to main content

PluginApiVt3Ext

Struct PluginApiVt3Ext 

Source
#[repr(C)]
pub struct PluginApiVt3Ext { pub declare: Option<extern "C" fn(json: StbStringRef) -> i32>, pub _reserved: [*mut c_void; 3], }
Expand description

The ABI v3 extension block, passed to rpi_plugin_register_v3 in addition to the frozen v2 PluginApiVt. Keeping v3 as a separate side struct means the v2 vtable layout never changes: a v2 plugin is unaffected, a v3 plugin reads both.

Every slot is nullable. A null slot means the host does not support that declaration yet — the plugin must null-check and degrade (skip the declaration; the host applies defaults: priority 100, all platforms).

Fields§

§declare: Option<extern "C" fn(json: StbStringRef) -> i32>

Declare this plugin’s host-side preferences as a JSON object, e.g. {"priority":60,"platforms":["linux","macos"]}.

  • priority (integer, default 100): dispatch order for this plugin’s handlers — smaller runs first (stable; registration order breaks ties). Suggested bands: 0..=49 infrastructure, 50..=99 connection, 100..=199 normal, 200+ post/cleanup.
  • platforms (array of strings, default all): platforms this plugin supports; the host skips the plugin’s handlers on any other platform. Recognised: "linux", "macos", "windows", "android".

Called during register. Returns 0 on success, nonzero on a handled error (host logs it and keeps the defaults).

§_reserved: [*mut c_void; 3]

Reserved for future v3 declarations. MUST be null-filled today; the host ignores these slots. Zeroing them lets a future host start using them without another ABI bump.

Implementations§

Source§

impl PluginApiVt3Ext

Source

pub const fn empty() -> Self

A v3 ext block with every slot null (no declarations). Useful for tests and hosts that support no declarations yet.

Trait Implementations§

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.