rhai/doc/src/SUMMARY.md
2020-12-23 19:11:41 +08:00

7.1 KiB

The Rhai Scripting Language

  1. What is Rhai
    1. Features
    2. Supported Targets and Builds
    3. What Rhai Isn't
    4. Licensing
    5. 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 to AST for Repeated Evaluations
    3. Call a Rhai Function from Rust
    4. Create a Rust Closure from a Rhai Function
    5. Evaluate Expressions Only
    6. Raw Engine
    7. Scope - Initializing and Maintaining State
    8. Engine Configuration Options
  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. Override a Built-in Function
    6. Operator Overloading
    7. Register any Rust Type and its Methods
      1. Property Getters and Setters
      2. Indexers
      3. Disable Custom Types
      4. Printing Custom Types
    8. Modules
      1. Create from Rust
      2. Create from AST
      3. Module Resolvers
        1. Custom Module Resolvers
    9. Plugins
      1. Export a Rust Module
      2. Export a Rust Function
    10. Packages
      1. Built-in Packages
      2. Custom Packages
  5. Rhai Language Reference
    1. Comments
      1. Doc-Comments
    2. Values and Types
      1. Dynamic Values
      2. Serialization/Deserialization with serde
      3. type_of()
      4. Numbers
        1. Operators
        2. Functions
        3. Value Conversions
      5. Strings and Characters
        1. Built-in Functions
      6. Arrays
      7. Object Maps
        1. Parse from JSON
        2. Special Support for OOP
      8. Time-Stamps
    3. Keywords
    4. Statements
    5. Variables
    6. Constants
    7. Logic Operators
    8. Assignment Operators
    9. If Statement
    10. Switch Expression
    11. While Loop
    12. Do Loop
    13. Loop Statement
    14. For Loop
      1. Iterators for Custom Types
    15. Return Values
    16. Throw Exception on Error
    17. Catch Exceptions
    18. Functions
      1. Call Method as Function
      2. Overloading
      3. Namespaces
      4. Function Pointers
      5. Currying
      6. Anonymous Functions
      7. Closures
    19. Print and Debug
    20. Modules
      1. Export Variables, Functions and Sub-Modules
      2. Import Modules
    21. Eval Function
  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. 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
  8. Usage Patterns
    1. Object-Oriented Programming (OOP)
    2. Working With Rust Enums
    3. Loadable Configuration
    4. Control Layer
    5. Singleton Command
    6. Multi-Layer Functions
    7. One Engine Instance Per Call
    8. Scriptable Event Handler with State
    9. Dynamic Constants Provider
  9. Advanced Topics
  10. Capture Scope for Function Call
  11. Low-Level API
  12. Variable Resolver
  13. Use as DSL 1. Disable Keywords and/or Operators 2. Custom Operators 3. Extending with Custom Syntax
  14. Multiple Instantiation
  15. Functions Metadata 4. Generate Function Signatures 5. Export Metadata to JSON
  16. Appendix
    1. Keywords
    2. Operators and Symbols
    3. Literals