pub trait ScriptingLoader<P: IntoScriptPluginParams> {
// Required methods
fn load(
attachment: &ScriptAttachment,
content: &[u8],
world: WorldGuard<'_>,
) -> Result<P::C, InteropError>;
fn reload(
attachment: &ScriptAttachment,
content: &[u8],
previous_context: &mut P::C,
world: WorldGuard<'_>,
) -> Result<(), InteropError>;
}Expand description
A utility trait for types implementing IntoScriptPluginParams.
Provides methods for initializing and reloading script contexts using the plugin’s context loader and reloader functions.
Required Methods§
Sourcefn load(
attachment: &ScriptAttachment,
content: &[u8],
world: WorldGuard<'_>,
) -> Result<P::C, InteropError>
fn load( attachment: &ScriptAttachment, content: &[u8], world: WorldGuard<'_>, ) -> Result<P::C, InteropError>
Loads a script context using the provided loader function
Sourcefn reload(
attachment: &ScriptAttachment,
content: &[u8],
previous_context: &mut P::C,
world: WorldGuard<'_>,
) -> Result<(), InteropError>
fn reload( attachment: &ScriptAttachment, content: &[u8], previous_context: &mut P::C, world: WorldGuard<'_>, ) -> Result<(), InteropError>
Reloads a script context using the provided reloader function
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.