From 9448c195819fd0701b0059cf7cb32c600d83ad00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hozda?= Date: Mon, 30 Oct 2017 13:08:40 +0100 Subject: [PATCH] fix version in README, continue documenting --- README.md | 4 ++-- src/engine.rs | 1 + src/fn_register.rs | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a02a84fa..2ea9a228 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Rhai's current feature set: * No additional dependencies * No unsafe code -**Note:** Currently, it's version 0.5.1, so the language and APIs may change before they stabilize.* +**Note:** Currently, it's version 0.6.2, so the language and APIs may change before they stabilize.* ## Installation @@ -20,7 +20,7 @@ You can install Rhai using crates by adding this line to your dependences: ``` [dependencies] -rhai = "0.5.1" +rhai = "0.6.2" ``` ## Related diff --git a/src/engine.rs b/src/engine.rs index e18b9386..1df8fbd4 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -106,6 +106,7 @@ pub enum FnType { /// } /// ``` pub struct Engine { + /// A hashmap containing all functions know to the engine pub fns: HashMap>, } diff --git a/src/fn_register.rs b/src/fn_register.rs index b0b63e52..d6d062f8 100644 --- a/src/fn_register.rs +++ b/src/fn_register.rs @@ -3,7 +3,10 @@ use std::boxed::Box; use engine::{EvalAltResult, Engine, FnType}; +/// A trait used for registering functions to an Engine +/// Currently, Rhai supports functions with up to 6 parameters pub trait FnRegister { + /// A method used for registering functions and methods to a Engine fn register_fn(&mut self, name: &str, f: A); }