pub struct PluginApi {
pub registry: Arc<FunctionRegistry>,
pub mod_id: u32,
}
Fields§
§registry: Arc<FunctionRegistry>
§mod_id: u32
Implementations§
Source§impl PluginApi
impl PluginApi
pub fn new(registry: Arc<FunctionRegistry>) -> Self
pub fn register_function( &self, name: &str, func: fn(&PluginApi, Option<PluginValue>) -> PluginValue, )
pub fn call_function( &self, function_name: &str, arg: Option<PluginValue>, ) -> PluginValue
pub fn unregister_function(&self, name: &str)
pub fn list_functions(&self) -> DashMap<u32, HashSet<String>>
pub fn get_function(&self, name: &str) -> Option<DashMap<u32, PluginFunction>>
pub fn load_plugins(&self, mods_dir: &str) -> Result<(), String>
Auto Trait Implementations§
impl Freeze for PluginApi
impl !RefUnwindSafe for PluginApi
impl Send for PluginApi
impl Sync for PluginApi
impl Unpin for PluginApi
impl !UnwindSafe for PluginApi
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