#![allow(unsafe_code)]
#![allow(clippy::indexing_slicing)]
#![allow(clippy::no_mangle_with_rust_abi)]
#![allow(non_local_definitions)]
#![allow(clippy::cast_ptr_alignment)]
#![allow(clippy::used_underscore_binding)]
#![allow(clippy::elidable_lifetime_names)]
#![allow(clippy::expl_impl_clone_on_copy)]
use abi_stable::StableAbi;
use abi_stable::sabi_trait;
use abi_stable::std_types::RBox;
use abi_stable::std_types::RResult;
use abi_stable::std_types::RString;
use abi_stable::std_types::RVec;
use crate::plugins::plugin_c::PluginHealth;
#[allow(non_local_definitions)]
#[sabi_trait]
pub trait StablePlugin: Send + Sync {
fn name(&self) -> RString;
fn api_version(&self) -> RString;
fn on_load(&self) -> RResult<(), RString>;
fn execute(
&self,
command: RString,
args: RVec<u8>,
) -> RResult<RVec<u8>, RString>;
fn health_check(&self) -> RResult<PluginHealth, RString>;
}
#[repr(C)]
#[derive(StableAbi)]
#[sabi(kind(Prefix(prefix_ref = RoVtable)))]
#[sabi(missing_field(panic))]
pub struct StablePluginModule {
pub name: extern "C" fn() -> RString,
pub version: extern "C" fn() -> RString,
pub new: extern "C" fn() -> StablePlugin_TO<'static, RBox<()>>,
}