Add serde deserialization.

This commit is contained in:
Stephen Chung
2020-07-03 17:19:55 +08:00
parent 1b7ffdf408
commit fa84e5c502
13 changed files with 723 additions and 4 deletions

View File

@@ -63,6 +63,7 @@
//! | `only_i64` | Set the system integer type to `i64` and disable all other integer types. `INT` is set to `i64`. |
//! | `no_std` | Build for `no-std`. Notice that additional dependencies will be pulled in to replace `std` features. |
//! | `sync` | Restrict all values types to those that are `Send + Sync`. Under this feature, `Engine`, `Scope` and [`AST`] are all `Send + Sync`. |
//! | `serde` | Enable serialization/deserialization via [`serde`]. Notice that the [`serde`](https://crates.io/crates/serde) crate will be pulled in together with its dependencies. |
//! | `internals` | Expose internal data structures (beware they may be volatile from version to version). |
//!
//! See [The Rhai Book](https://schungx.github.io/rhai) for details on the Rhai script engine and language.
@@ -86,6 +87,7 @@ pub mod packages;
mod parser;
mod result;
mod scope;
mod serde;
mod stdlib;
mod token;
mod r#unsafe;
@@ -127,6 +129,11 @@ pub mod module_resolvers {
pub use crate::module::resolvers::*;
}
#[cfg(feature = "serde")]
pub mod de {
pub use crate::serde::de::from_dynamic;
}
#[cfg(not(feature = "no_optimize"))]
pub use optimize::OptimizationLevel;