Trait ConfigureScriptPlugin

Source
pub trait ConfigureScriptPlugin {
    type P: IntoScriptPluginParams;

    // Required methods
    fn add_context_initializer(
        self,
        initializer: ContextInitializer<Self::P>,
    ) -> Self;
    fn add_context_pre_handling_initializer(
        self,
        initializer: ContextPreHandlingInitializer<Self::P>,
    ) -> Self;
    fn add_runtime_initializer(
        self,
        initializer: RuntimeInitializer<Self::P>,
    ) -> Self;
    fn enable_context_sharing(self);
}
Expand description

Utility trait for configuring all scripting plugins.

Required Associated Types§

Source

type P: IntoScriptPluginParams

The type of the plugin to configure

Required Methods§

Source

fn add_context_initializer( self, initializer: ContextInitializer<Self::P>, ) -> Self

Add a context initializer to the plugin

Source

fn add_context_pre_handling_initializer( self, initializer: ContextPreHandlingInitializer<Self::P>, ) -> Self

Add a context pre-handling initializer to the plugin

Source

fn add_runtime_initializer( self, initializer: RuntimeInitializer<Self::P>, ) -> Self

Add a runtime initializer to the plugin

Source

fn enable_context_sharing(self)

Switch the context assigning strategy to a global context assigner.

This means that all scripts will share the same context. This is useful for when you want to share data between scripts easilly. Be careful however as this also means that scripts can interfere with each other in unexpected ways!.

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.

Implementors§