Document how to enable serde feature flag

Relates to #21
This commit is contained in:
Sebastian Schmidt 2019-03-27 18:34:49 +01:00
parent 1574514220
commit 24ca11e52a
2 changed files with 16 additions and 0 deletions

View File

@ -246,6 +246,14 @@ Functions have a precedence of 190.
### [Serde](https://serde.rs)
To use this crate with serde, the serde feature flag has to be set.
This can be done like this in the `Cargo.toml`:
```toml
[dependencies]
evalexpr = {version = "1", features = ["serde"]}
```
This crate implements `serde::de::Deserialize` for its type `Node` that represents a parsed expression tree.
The implementation expects a [serde `string`](https://serde.rs/data-model.html) as input.
Example parsing with [ron format](docs.rs/ron):

View File

@ -233,6 +233,14 @@
//!
//! ### [Serde](https://serde.rs)
//!
//! To use this crate with serde, the serde feature flag has to be set.
//! This can be done like this in the `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! evalexpr = {version = "1", features = ["serde"]}
//! ```
//!
//! This crate implements `serde::de::Deserialize` for its type `Node` that represents a parsed expression tree.
//! The implementation expects a [serde `string`](https://serde.rs/data-model.html) as input.
//! Example parsing with [ron format](docs.rs/ron):