Skip to content

v.0.17.0

Compare
Choose a tag to compare
@schungx schungx released this 13 Jul 11:46
15292f4

Version 0.17.0 released to crates.io

This version adds:

  • serde support for working with Dynamic values (particularly object maps).
  • Low-level API to register functions.
  • Surgically disable keywords and/or operators in the language.
  • Define custom operators.
  • Extend the language via custom syntax.

Bug fixes

  • Fixed method calls in the middle of a dot chain.

Breaking changes

  • EvalAltResult::ErrorMismatchOutputType has an extra argument containing the name of the requested type.
  • Engine::call_fn_dynamic take an extra argument, allowing a Dynamic value to be bound to the this pointer.
  • Precedence of the % (modulo) operator is lowered to below << ad >>. This is to handle the case of x << 3 % 10.

New features

  • New serde feature to allow serializating/deserializating to/from Dynamic values using serde.
    This is particularly useful when converting a Rust struct to a Dynamic object map and back.
  • Engine::disable_symbol to surgically disable keywords and/or operators.
  • Engine::register_custom_operator to define a custom operator.
  • Engine::register_custom_syntax to define a custom syntax.
  • New low-level API Engine::register_raw_fn and Engine::register_raw_fn_XXX.
  • New low-level API Module::set_raw_fn mirroring Engine::register_raw_fn.
  • AST::clone_functions_only, AST::clone_functions_only_filtered and AST::clone_statements_only to clone only part of an AST.
  • The boolean ^ (XOR) operator is added.
  • FnPtr is exposed as the function pointer type.
  • rhai::module_resolvers::ModuleResolversCollection added to try a list of module resolvers.
  • It is now possible to mutate the first argument of a module-qualified function call when the argument is a simple variable (but not a module constant).
  • Many configuration/setting API's now returns &mut Self so that the calls can be chained.
  • String parameters in functions are supported (but inefficiently).