rhai/doc/src/SUMMARY.md
2020-07-05 17:41:45 +08:00

5.5 KiB

The Rhai Scripting Language

  1. What is Rhai
    1. Features
    2. Supported Targets and Builds
    3. What Rhai Isn't
    4. Related Resources
  2. Getting Started
    1. Online Playground
    2. Install the Rhai Crate
    3. Optional Features
    4. Special Builds
      1. Performance
      2. Minimal
      3. no-std
      4. WebAssembly (WASM)
    5. Examples
      1. Rust
      2. Scripts
  3. Using the Engine
    1. Hello World in Rhai - Evaluate a Script
    2. Compile a Script to AST for Repeated Evaluations
    3. Call a Rhai Function from Rust
    4. Create a Rust Anonymous Function from a Rhai Function
    5. Evaluate Expressions Only
    6. Raw Engine
  4. Extend Rhai with Rust
    1. Traits
    2. Register a Rust Function
      1. String Parameters in Rust Functions
    3. Register a Generic Rust Function
    4. Register a Fallible Rust Function
    5. Packages
      1. Built-in Packages
      2. Create a Custom Package
    6. Override a Built-in Function
    7. Operator Overloading
    8. Register a Custom Type and its Methods
      1. Getters and Setters
      2. Indexers
      3. Disable Custom Types
      4. Printing Custom Types
    9. Scope - Initializing and Maintaining State
    10. Engine Configuration Options
  5. Rhai Language Reference
    1. Comments
    2. Values and Types
      1. Dynamic Values
      2. type-of()
      3. Numbers
        1. Operators
        2. Functions
        3. Value Conversions
      4. Strings and Characters
        1. Built-in Functions
      5. Arrays
      6. Object Maps
        1. Parse from JSON
        2. Special Support for OOP
      7. Time-Stamps
    3. Keywords
    4. Statements
    5. Variables
    6. Constants
    7. Logic Operators
    8. If Statement
    9. While Loop
    10. Loop Statement
    11. For Loop
    12. Return Values
    13. Throw Exception on Error
    14. Functions
      1. Call Method as Function
      2. Overloading
      3. Namespaces
      4. Function Pointers
    15. Print and Debug
    16. Modules
      1. Export Variables, Functions and Sub-Modules
      2. Import Modules
      3. Create from Rust
      4. Create from AST
      5. Module Resolvers
        1. Implement a Custom Module Resolver
  6. Safety and Protection
    1. Checked Arithmetic
    2. Sand-Boxing
    3. Maximum Length of Strings
    4. Maximum Size of Arrays
    5. Maximum Size of Object Maps
    6. Maximum Number of Operations
      1. Tracking Progress and Force-Termination
    7. Maximum Number of Modules
    8. Maximum Call Stack Depth
    9. Maximum Statement Depth
  7. Advanced Topics
    1. Object-Oriented Programming (OOP)
    2. Serialization/Deserialization of Dynamic with serde
    3. Script Optimization
      1. Optimization Levels
      2. Re-Optimize an AST
      3. Eager Function Evaluation
      4. Side-Effect Considerations
      5. Volatility Considerations
      6. Subtle Semantic Changes
    4. Disable Keywords and/or Operators
    5. Custom Operators
    6. Eval Statement
  8. Appendix
    1. Keywords
    2. Operators
    3. Literals