pub struct ExternalFunctions {
pub functions: Arc<Mutex<HashMap<String, FunctionProxy>>>,
/* private fields */
}Fields§
§functions: Arc<Mutex<HashMap<String, FunctionProxy>>>Implementations§
Source§impl ExternalFunctions
impl ExternalFunctions
pub fn new(path_to_plugin: &PathBuf) -> ExternalFunctions
Sourcepub unsafe fn load<P: AsRef<OsStr>>(&mut self, library_path: P) -> Result<()>
pub unsafe fn load<P: AsRef<OsStr>>(&mut self, library_path: P) -> Result<()>
Load a plugin library and add all contained functions to the internal function table.
§Safety
A plugin library must be implemented using the
[plugins_core::plugin_declaration!()] macro. Trying manually implement
a plugin without going through that macro will result in undefined
behaviour.
pub fn load_from_file(&mut self, plugin_path: &PathBuf) -> Result<()>
pub fn call( &self, function: &str, arguments: Value, ) -> Result<String, InvocationError>
pub fn has(&self, key: &str) -> bool
Trait Implementations§
Source§impl Clone for ExternalFunctions
impl Clone for ExternalFunctions
Source§fn clone(&self) -> ExternalFunctions
fn clone(&self) -> ExternalFunctions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExternalFunctions
impl Debug for ExternalFunctions
Source§impl Default for ExternalFunctions
impl Default for ExternalFunctions
Source§fn default() -> ExternalFunctions
fn default() -> ExternalFunctions
Returns the “default value” for a type. Read more
impl Send for ExternalFunctions
impl Sync for ExternalFunctions
Auto Trait Implementations§
impl Freeze for ExternalFunctions
impl RefUnwindSafe for ExternalFunctions
impl Unpin for ExternalFunctions
impl UnwindSafe for ExternalFunctions
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