Commit Graph

34 Commits

Author SHA1 Message Date
Stephen Chung
ae59a3321b Add support for deserialization of custom type/shared value from into another Dynamic. 2023-04-28 23:16:00 +08:00
Mathieu Lala
9af5b1c78e
fix: default clippy lints 2022-12-30 18:07:39 +01:00
Stephen Chung
9f5b68549a Deserialize large numbers. 2022-11-23 16:13:57 +08:00
Stephen Chung
05c7d00a8e Deserialize to serde_json::Value 2022-11-22 16:25:25 +08:00
Stephen Chung
94aeab1015 Remove serde_bytes. 2022-11-22 15:52:31 +08:00
Stephen Chung
b2e4efd872 Fine tune serde. 2022-11-22 15:38:16 +08:00
Stephen Chung
ce046422f0 Add Dynamic::is_XXX API. 2022-11-09 12:44:57 +08:00
Stephen Chung
8d1310c0f3 Make Scope serializable. 2022-09-26 18:14:45 +08:00
Stephen Chung
b56a9c22f3 Refactor. 2022-09-25 12:24:03 +08:00
Stephen Chung
be448dfe4d Use identifiers in format! 2022-08-11 19:01:23 +08:00
Stephen Chung
e4d492c727 Fix no_object build. 2022-05-23 22:58:15 +08:00
Geoffroy Couprie
f2b5566c0b use smartstring's deserializer to support non borrowed strings
The map visitor for Dynamic was expecting a &str for the key, but the
serde_json deserializer internally uses a Cow string, which can be
Borrowed or Owned. In the case of Owned, the serde_json key deserializer
is calling visit_string on the Visitor, which for &str will result in
the error:
Error("invalid type: string \"a\", expected a borrowed string", line: 0,
column: 0)

smartstring actually has its own Visitor implementation that handles
both cases, so we can use it instead of an explicit conversion.
2022-05-23 16:40:49 +02:00
Stephen Chung
00b189d0c6 Replace Cow<str> in Scope with SmartString. 2022-01-15 11:26:43 +08:00
Stephen Chung
5dae2b07f7 Add to_dynamic test for Option. 2022-01-13 19:02:37 +08:00
Stephen Chung
f92cbe1f6d Merge branch 'v1.3-fixes' 2021-12-16 16:10:39 +08:00
Stephen Chung
224aa0ea68 Allow custom syntax inside binary operator expressions. 2021-12-16 16:06:44 +08:00
Stephen Chung
ef14079c61 Add ranges. 2021-12-15 12:06:17 +08:00
Stephen Chung
41dd989866 Support deserialization into byte arrays for BLOB's via serde_bytes. 2021-12-02 14:10:53 +08:00
Stephen Chung
5363b0724f Support Option in from_dynamic. 2021-12-02 12:50:11 +08:00
Stephen Chung
94674679d9 Rename as_string and as_immutable_string. 2021-08-17 15:50:55 +08:00
Stephen Chung
79d9977cd5 Change take_string and take_immutable_string to as_XXX. 2021-06-10 10:45:44 +08:00
Stephen Chung
7ec49a9510 Fix f32_feature with serde. 2021-04-06 23:18:28 +08:00
Stephen Chung
f92e6f3983 Fix metadata build. 2021-03-05 23:56:00 +08:00
Stephen Chung
426f841aa2 Fix serde build. 2021-03-05 23:41:20 +08:00
Stephen Chung
3650b04c38 Add Decimal number type. 2021-02-13 20:57:56 +08:00
Stephen Chung
ec272cf9b9 Add Serialize/Deserialize for Dynamic and ImmutableString. 2021-01-18 10:30:58 +08:00
Stephen Chung
c463e42987 Fix serde test. 2020-10-10 14:15:23 +08:00
Stephen Chung
a2c0554f3c Make consistent style. 2020-07-06 21:52:07 +08:00
Alvin Wong
4a3a32dc3a Fix serializing externally-tagged enum representations 2020-07-06 21:11:41 +08:00
Alvin Wong
4b6afc9c72 Add enum serialization tests 2020-07-06 18:32:22 +08:00
Alvin Wong
0644c67252 Impl. deserializing enum representations 2020-07-06 18:32:22 +08:00
Alvin Wong
8f53ce50d4 Ensure rhai::INT can be deserialized into any integer types 2020-07-06 15:30:56 +08:00
Stephen Chung
78c94daf46 Add ser::to_dynamic. 2020-07-03 22:42:56 +08:00
Stephen Chung
fa84e5c502 Add serde deserialization. 2020-07-03 17:19:55 +08:00