This repository has been archived on 2025-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
rhaj/rhai_engine/rhaibook/rust/traits.md
2025-04-03 09:18:05 +02:00

16 lines
1.6 KiB
Markdown

Traits
======
{{#include ../links.md}}
A number of traits, under the `rhai::` module namespace, provide additional functionalities.
| Trait | Description | Methods |
| ------------------------ | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| `CustomType` | trait to build a [custom type] for use with an [`Engine`] | `build` |
| `Func` | trait for creating Rust closures from script | `create_from_ast`, `create_from_script` |
| `FuncArgs` | trait for parsing function call arguments | `parse` |
| `ModuleResolver` | trait implemented by [module resolution][module resolver] services | `resolve`, `resolve_ast`, `resolve_raw` |
| `packages::Package` | trait implemented by [packages] | `init`, `init_engine`, `register_into_engine`, `register_into_engine_as`, `as_shared_module` |
| `plugin::PluginFunction` | trait implemented by [plugin] functions | `call`, `is_method_call`, `has_context`, `is_pure` |