feat: fix register_function docs in epapi

This commit is contained in:
Byson94
2025-11-22 17:41:24 +05:30
parent 6456b2998d
commit 4167c64fde

View File

@@ -87,14 +87,17 @@ pub trait EwwiiAPI: Send + Sync {
/// # Example
///
/// ```rust
/// use ewwii_plugin_api::{EwwiiAPI, Plugin};
/// use ewwii_plugin_api::{EwwiiAPI, Plugin, rhai_backend::RhaiFnNamespace};
/// use rhai::Dynamic;
///
/// pub struct DummyStructure;
///
/// impl Plugin for DummyStructure {
/// fn init(&self, host: &dyn EwwiiAPI) {
/// host.register_function("my_func".to_string(), Box::new(|args| {
/// host.register_function(
/// "my_func".to_string(),
/// RhaiFnNamespace::Global,
/// Box::new(|args| {
/// // Do stuff
/// // - Perform things on the args (if needed)
/// // - And return a value