Crate bevy_dynamic_plugin
source ·Expand description
Bevy’s dynamic plugin loading functionality.
This crate allows loading dynamic libraries (.dylib
, .so
) that export a single
Plugin
. For usage, see dynamically_load_plugin
.
§Deprecation
The current dynamic plugin system is unsound and will be removed in 0.15. You may be interested in the Alternatives listed below. If your use-case is not supported, please consider commenting on #13080 describing how you use dynamic plugins in your project.
§Warning
Note that dynamic linking and loading is inherently unsafe because it allows executing foreign code. Additionally, Rust does not have a stable ABI and may produce incompatible libraries across Rust versions, or even subsequent compilations. This will not work well in scenarios such as modding, but can work if the dynamic plugins and the main app are built at the same time, such as with Downloadable Content (DLC) packs.
§Alternatives
You may be interested in these safer alternatives:
- Bevy Assets - Scripting: Scripting and modding libraries for Bevy
- Bevy Assets - Development tools: Hot reloading and other development functionality
stabby
: Stable Rust ABI
Enums§
- Dynamic
Plugin Load Error Deprecated Errors that can occur when loading a dynamic plugin
Traits§
- Dynamic
Plugin Ext Deprecated An extension trait forApp
that allows loading dynamic plugins.
Functions§
- dynamically_
load_ ⚠plugin Deprecated Dynamically links a plugin at the given path. The plugin must export a function with theCreatePlugin
signature named_bevy_create_plugin
.