Revise docs.
This commit is contained in:
@@ -34,9 +34,11 @@ Macro Parameters
|
||||
```rust
|
||||
// Import necessary types and traits.
|
||||
use rhai::{
|
||||
def_package,
|
||||
packages::Package,
|
||||
packages::{ArithmeticPackage, BasicArrayPackage, BasicMapPackage, LogicPackage}
|
||||
def_package, // 'def_package!' macro
|
||||
packages::Package, // 'Package' trait
|
||||
packages::{ // pre-defined packages
|
||||
ArithmeticPackage, BasicArrayPackage, BasicMapPackage, LogicPackage
|
||||
}
|
||||
};
|
||||
|
||||
// Define the package 'MyPackage'.
|
||||
|
@@ -9,10 +9,12 @@ Packages reside under `rhai::packages::*` and the trait `rhai::packages::Package
|
||||
packages to be used.
|
||||
|
||||
Packages typically contain Rust functions that are callable within a Rhai script.
|
||||
All functions registered in a package is loaded under the _global namespace_ (i.e. they're available without module qualifiers).
|
||||
All functions registered in a package is loaded under the _global namespace_
|
||||
(i.e. they're available without module qualifiers).
|
||||
|
||||
Once a package is created (e.g. via `Package::new`), it can be _shared_ (via `Package::get`) among multiple instances of [`Engine`],
|
||||
even across threads (under [`sync`]). Therefore, a package only has to be created _once_.
|
||||
Once a package is created (e.g. via `Package::new`), it can be _shared_ (via `Package::get`)
|
||||
among multiple instances of [`Engine`], even across threads (under [`sync`]).
|
||||
Therefore, a package only has to be created _once_.
|
||||
|
||||
```rust
|
||||
use rhai::Engine;
|
||||
|
Reference in New Issue
Block a user