diff --git a/doc/src/links.md b/doc/src/links.md index 1f666afc..0231689b 100644 --- a/doc/src/links.md +++ b/doc/src/links.md @@ -85,6 +85,7 @@ [function]: {{rootUrl}}/language/functions.md [functions]: {{rootUrl}}/language/functions.md [function overloading]: {{rootUrl}}/rust/functions.md#function-overloading +[fallible function]: {{rootUrl}}/rust/fallible.md [fallible functions]: {{rootUrl}}/rust/fallible.md [function pointer]: {{rootUrl}}/language/fn-ptr.md [function pointers]: {{rootUrl}}/language/fn-ptr.md diff --git a/doc/src/plugins/function.md b/doc/src/plugins/function.md index f138d5c4..43af9e13 100644 --- a/doc/src/plugins/function.md +++ b/doc/src/plugins/function.md @@ -14,9 +14,9 @@ Macros | Macro | Apply to | Behavior | | ------------------------ | ------------------------------------------------------------- | --------------------------------------------------------- | | `#[export_fn]` | Rust function defined in module | Export the function | -| `#[rhai_fn(return_raw)]` | Rust function returning `Result>` | Specify that this is a fallible function | -| `register_exported_fn!` | [`Engine`] instance, register name, function name | Register function with the [`Engine`] under specific name | -| `set_exported_fn!` | [`Module`], register name, function name | Register function with the [`Module`] under specific name | +| `#[rhai_fn(return_raw)]` | Rust function returning `Result>` | Specify that this is a [fallible function] | +| `register_exported_fn!` | [`Engine`] instance, register name, function name | Register function into the [`Engine`] under specific name | +| `set_exported_fn!` | [`Module`], register name, function name | Register function into the [`Module`] under specific name | `#[export_fn]` and `register_exported_fn!` diff --git a/doc/src/plugins/module.md b/doc/src/plugins/module.md index ac558c61..22380425 100644 --- a/doc/src/plugins/module.md +++ b/doc/src/plugins/module.md @@ -20,12 +20,12 @@ Macros | --------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------- | | `#[export_module]` | Rust module | Export all `pub` functions | | `#[rhai_fn(skip)]` | Function in Rust module | Do not export this function | -| `#[rhai_fn(return_raw)]` | `pub` function in Rust module returning `Result>` | Specify that this is a fallible function | +| `#[rhai_fn(return_raw)]` | `pub` function in Rust module returning `Result>` | Specify that this is a [fallible function] | | `#[rhai_fn(name = "...")]` | `pub` function in Rust module | Register function under specific name | | `#[rhai_fn(get = "...")]` | `pub` function in Rust module (first parameter must be `&mut`) | Register a property getter under specific name | | `#[rhai_fn(set = "...")]` | `pub` function in Rust module (first parameter must be `&mut`) | Register a property setter under specific name | -| `#[rhai_fn(index_get]` | `pub` function in Rust module (first parameter must be `&mut`) | Register a index getter | -| `#[rhai_fn(index_set)]` | `pub` function in Rust module (first parameter must be `&mut`) | Register a index setter | +| `#[rhai_fn(index_get]` | `pub` function in Rust module (first parameter must be `&mut`) | Register an index getter | +| `#[rhai_fn(index_set)]` | `pub` function in Rust module (first parameter must be `&mut`) | Register an index setter | | `#[rhai_mod(name = "...")]` | `pub` sub-module in Rust module | Export the sub-module under specific name | | `exported_module!` | Rust module name | Create a [module] containing exported functions | @@ -121,7 +121,7 @@ mod my_module { obj.list[index] } // This is an index setter for 'MyType'. - #[rhai_fn(index_get)] + #[rhai_fn(index_set)] pub fn get_index(obj: &mut MyType, index: i64, state: bool) { obj.list[index] = state; }