mln_engine/plugin/mod.rs
1//! Direct in-process host adapter for [`mln_plugin`] layer plugins.
2//!
3//! Registers any [`mln_plugin::LayerPlugin`] directly on
4//! [`crate::RegistryBuilder::add_layer_plugin`] without crossing the C Plugin
5//! ABI, enabling the same plugin crate to run natively, on Wasm, and over the
6//! C ABI (`mln_plugin_c`).
7
8mod layer;
9mod program;
10
11pub use layer::build_layer_type;
12
13/// Borrows an engine [`View`](crate::camera::View) as an [`mln_plugin::View`]
14/// for the duration of `f` (useful in plugin unit tests).
15pub fn with_view<R>(view: &crate::camera::View, f: impl FnOnce(mln_plugin::View<'_>) -> R) -> R {
16 layer::with_view(view, f)
17}