pub struct LuaManager { /* private fields */ }
Expand description
The main manager type for Lua plugins.
This struct is responsible for managing the lifecycle of Lua plugins, including loading, unloading, and interacting with them. It maintains a mapping of plugin bundles to their respective Lua states.
§Thread Safety
LuaManager
is Send
and Sync
, allowing it to be used safely across
thread boundaries. Each plugin’s Lua state is protected by a mutex to
ensure thread safety.
Implementations§
Trait Implementations§
Source§impl Default for LuaManager
impl Default for LuaManager
Source§impl<'a> Manager<'a, Result<Option<Variable>, Box<dyn Error + Send + Sync>>, StdInfo> for LuaManager
impl<'a> Manager<'a, Result<Option<Variable>, Box<dyn Error + Send + Sync>>, StdInfo> for LuaManager
Source§fn register_plugin(
&mut self,
context: RegisterPluginContext<'_>,
) -> ManagerResult<StdInfo>
fn register_plugin( &mut self, context: RegisterPluginContext<'_>, ) -> ManagerResult<StdInfo>
Registers a new plugin.
Source§fn unregister_plugin(
&mut self,
plugin: &Plugin<'a, FunctionOutput, StdInfo>,
) -> ManagerResult<()>
fn unregister_plugin( &mut self, plugin: &Plugin<'a, FunctionOutput, StdInfo>, ) -> ManagerResult<()>
Unregisters a plugin.
Source§fn load_plugin(
&mut self,
context: LoadPluginContext<'a, '_, FunctionOutput, StdInfo>,
api: Api<FunctionOutput, StdInfo>,
) -> ManagerResult<()>
fn load_plugin( &mut self, context: LoadPluginContext<'a, '_, FunctionOutput, StdInfo>, api: Api<FunctionOutput, StdInfo>, ) -> ManagerResult<()>
Loads a plugin into memory.
Source§fn unload_plugin(
&mut self,
plugin: &Plugin<'a, FunctionOutput, StdInfo>,
) -> Result<(), Box<dyn Error + Send + Sync>>
fn unload_plugin( &mut self, plugin: &Plugin<'a, FunctionOutput, StdInfo>, ) -> Result<(), Box<dyn Error + Send + Sync>>
Unloads a plugin from memory.
Auto Trait Implementations§
impl Freeze for LuaManager
impl RefUnwindSafe for LuaManager
impl Send for LuaManager
impl Sync for LuaManager
impl Unpin for LuaManager
impl UnwindSafe for LuaManager
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more