Skip to main content

mln_engine/plugin/
mod.rs

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