pub trait GetPluginThreadConfig<P>where
P: IntoScriptPluginParams + ?Sized,{
// Required methods
fn readonly_configuration(world: WorldId) -> ScriptingPluginConfiguration<P>;
fn set_world_local_config(
world: WorldId,
config: ScriptingPluginConfiguration<P>,
);
}Expand description
A utility trait for accessing the readonly configuration for types that provide some.
This is typically implemented using the make_plugin_config_static! macro.
The default implementation will allow you to statically retrieve the configuration for a given world id.
I.e. this config is not quite thread-local but world-local, meaning it should play nice with tests.
Required Methods§
Sourcefn readonly_configuration(world: WorldId) -> ScriptingPluginConfiguration<P>
fn readonly_configuration(world: WorldId) -> ScriptingPluginConfiguration<P>
Get a reference to the readonly configuration.
Sourcefn set_world_local_config(
world: WorldId,
config: ScriptingPluginConfiguration<P>,
)
fn set_world_local_config( world: WorldId, config: ScriptingPluginConfiguration<P>, )
Set the configuration or overwrites it if already set.
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.