Skip to main content

LegacyPluginApiV1

Struct LegacyPluginApiV1 

Source
#[repr(C)]
pub struct LegacyPluginApiV1 {
Show 14 fields pub free_string: FreeStringFn, pub register_tool: Option<extern "C" fn(schema: *const StableToolSchema, execute_fn: ToolExecuteFn, poll_fn: ToolPollFn, cancel_fn: ToolCancelFn, destroy_fn: ToolDestroyFn, plugin_free_string: FreeStringFn) -> i32>, pub register_command: Option<extern "C" fn(name: StbStringRef, description: StbStringRef, handler: CommandHandlerFn) -> i32>, pub register_shortcut: Option<extern "C" fn(key: StbStringRef, description: StbStringRef) -> i32>, pub register_flag: Option<extern "C" fn(name: StbStringRef, description: StbStringRef) -> i32>, pub register_provider: Option<extern "C" fn(provider_id: StbStringRef, base_url: StbStringRef, api_style: StbStringRef, request_fn: ProviderRequestFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>, pub register_message_renderer: Option<extern "C" fn(name: StbStringRef, render_fn: RenderFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>, pub register_markdown_transformer: Option<extern "C" fn(name: StbStringRef, render_fn: RenderFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>, pub register_entry_renderer: Option<extern "C" fn(name: StbStringRef, render_fn: RenderFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>, pub register_event_handler: Option<extern "C" fn(tag: EventTag, handler: EventHandlerFn, user_data: *mut c_void) -> i32>, pub register_resources_discover: Option<extern "C" fn(handler: ResourcesDiscoverFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>, pub runtime_action: LegacyRuntimeActionFn, pub dispatch_event: Option<extern "C" fn(event: StablePluginEvent, user_data: *mut c_void) -> i32>, pub user_data: *mut c_void,
}
Expand description

Frozen host vtable layout used by plugins exporting LEGACY_REGISTER_SYMBOL. Do not add, remove, reorder, or retype fields in this struct. New plugins use PluginApiVt and REGISTER_SYMBOL_V2.

The v1 action slot accepts only the historical ids 0..=15. Hosts must validate the raw u32 before dispatching it.

Fields§

§free_string: FreeStringFn§register_tool: Option<extern "C" fn(schema: *const StableToolSchema, execute_fn: ToolExecuteFn, poll_fn: ToolPollFn, cancel_fn: ToolCancelFn, destroy_fn: ToolDestroyFn, plugin_free_string: FreeStringFn) -> i32>§register_command: Option<extern "C" fn(name: StbStringRef, description: StbStringRef, handler: CommandHandlerFn) -> i32>§register_shortcut: Option<extern "C" fn(key: StbStringRef, description: StbStringRef) -> i32>§register_flag: Option<extern "C" fn(name: StbStringRef, description: StbStringRef) -> i32>§register_provider: Option<extern "C" fn(provider_id: StbStringRef, base_url: StbStringRef, api_style: StbStringRef, request_fn: ProviderRequestFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>§register_message_renderer: Option<extern "C" fn(name: StbStringRef, render_fn: RenderFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>§register_markdown_transformer: Option<extern "C" fn(name: StbStringRef, render_fn: RenderFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>§register_entry_renderer: Option<extern "C" fn(name: StbStringRef, render_fn: RenderFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>§register_event_handler: Option<extern "C" fn(tag: EventTag, handler: EventHandlerFn, user_data: *mut c_void) -> i32>§register_resources_discover: Option<extern "C" fn(handler: ResourcesDiscoverFn, plugin_free_string: FreeStringFn, user_data: *mut c_void) -> i32>§runtime_action: LegacyRuntimeActionFn§dispatch_event: Option<extern "C" fn(event: StablePluginEvent, user_data: *mut c_void) -> i32>§user_data: *mut c_void

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.