Commit Graph

49 Commits

Author SHA1 Message Date
Erick Tryzelaar
09de237033 Allow Vecs, BTreeMaps, and HashMaps to be deserialized from a unit
Closes #36
2015-03-20 08:47:33 -07:00
Erick Tryzelaar
d17846eff1 Add deserializer type hinting hooks
Formats like xml have trouble knowing if they should deserialize
tags into a sequence from the stream they are deserializing from.
This PR adds hooks so the deserializee can inform the deserializer
to provide them a sequence if possible.

Closes #38.
2015-03-20 08:32:33 -07:00
Erick Tryzelaar
eb4af09456 Simplify the variant deserializer visitor 2015-03-18 07:35:05 -07:00
Erick Tryzelaar
78137ee3a4 Rewrite enum deserialization to not require allocations 2015-03-16 22:42:04 -07:00
Oliver Schneider
f21cbb71e2 MapVisitor::end and SeqVisitor::end were mostly never called 2015-03-16 13:27:00 +01:00
Erick Tryzelaar
dc87288f48 Allow json missing fields to be treated as a null
Closes #34.
2015-03-12 20:44:16 -07:00
Erick Tryzelaar
805a3435cf Replace serde1 with serde2!
Closes #26!
2015-03-08 22:56:33 -07:00
Erick Tryzelaar
4dccf8cdec Clean up warnings in serde 2015-02-13 10:26:13 -08:00
Thomas Bahn
9a284ae7c2 Follow rust std: fmt::Show was renamed to fmt::Debug 2015-02-06 22:23:16 +01:00
Thomas Bahn
5dd077969c Use slicing syntax instead of .as_slice() 2015-02-06 22:23:16 +01:00
Thomas Bahn
361acd37d0 Follow rust std: int, uint were renamed to isize, usize 2015-02-06 22:23:15 +01:00
Dan Burkert
460dbce8cc Update for rustc 1.0.0-nightly (8903c21d6 2015-01-15 22:42:58 +0000) 2015-01-17 16:36:15 -08:00
Erick Tryzelaar
b98719a4a0 update to rust HEAD, switch to rustc_serialize 2015-01-04 17:18:50 -08:00
Thomas Bahn
589a07d4c9 Silence deprecation warnings
str::char_len() is deprecated in favour of chars().count()
2014-12-23 18:05:58 +01:00
Thomas Bahn
681a609844 Replace TreeMap with BTreeMap in the serde tests 2014-12-23 17:44:26 +01:00
Thomas Bahn
19bda6a90d Replace TreeMap/TreeSet with BTreeMap/BTreeSet in serde
Follow rust std changes:
https://github.com/rust-lang/rfcs/blob/master/text/0509-collections-reform-part-2.md
2014-12-20 14:42:48 +01:00
Thomas Bahn
d6807c0e90 Append semicolon to item macro invocations in serde
Following changes in rustc.
2014-12-19 08:59:11 +01:00
Erick Tryzelaar
73f375673b Simplify down some code 2014-12-14 11:34:27 -08:00
Erick Tryzelaar
246396fdb4 update to rust HEAD, fix the tests 2014-12-13 16:55:42 -08:00
Erick Tryzelaar
9d55333f06 update to the latest nightly 2014-12-01 12:21:18 -08:00
Erick Tryzelaar
857723dff6 Fix serde to compile on master again 2014-11-22 16:27:01 -08:00
Erick Tryzelaar
ff8c8c77cc Update to latest rust master 2014-11-17 19:21:46 -08:00
Erick Tryzelaar
18d943e8a7 migrate json deserializer into it's own module, clean up errors 2014-11-14 20:55:49 -08:00
Erick Tryzelaar
21a58e86e4 Rename Serializable to Serialize, Deserializable to Deserialize 2014-11-13 07:54:44 -08:00
Renato Zannon
bad51b197f Fix new deprecations from collections reform 2014-11-07 18:28:31 -02:00
Renato Zannon
ba67a8b3b2 Updates to match new operator method lookup 2014-11-07 18:23:44 -02:00
Erick Tryzelaar
475fd50564 rewrite deserialization to allow for copy-less struct fields 2014-10-23 10:26:52 -07:00
Erick Tryzelaar
538fcf244f fix the remaining warnings 2014-10-06 21:50:22 -07:00
Erick Tryzelaar
da34268be1 Fix some lints 2014-10-06 21:44:01 -07:00
kvark
997d3901c1 Fixed all the tests 2014-09-29 21:58:22 -04:00
kvark
bfd1fb0ee9 Fixed String and Option conflicts for the latest Rust 2014-09-29 21:50:24 -04:00
kvark
4a713cdbea Improved SyntaxError 2014-09-07 09:59:17 -04:00
kvark
6b62229dae Updated non_snake_case and struct lifetimes for the latest Rust 2014-09-04 21:57:13 -04:00
Erick Tryzelaar
a24075559f Move the Deserializer typarams onto from the method to the Deserializable trait 2014-08-19 15:18:47 -07:00
Erick Tryzelaar
aff53e8dd4 allow the deserializer to optionally handle missing fields
This allows json to deserialize missing values as a `null`.
2014-08-18 07:40:36 -07:00
Erick Tryzelaar
c6d28afb6f add a "ignore_field" handler when a deserializable is skipping a field 2014-08-18 07:40:15 -07:00
Erick Tryzelaar
45e8bd6834 change error handlers to be mutable 2014-08-18 07:39:34 -07:00
Erick Tryzelaar
f967a77a80 add tests to deserializing sequences into a tuple 2014-08-14 19:08:41 -07:00
Erick Tryzelaar
dce88b74da Fix deserializing a tuple from a sequence 2014-08-14 19:03:23 -07:00
Erick Tryzelaar
9d1f777282 Share => Sync 2014-08-14 09:38:19 -07:00
Erick Tryzelaar
98aa2e7884 Flesh out error handling 2014-08-06 22:24:06 -04:00
Erick Tryzelaar
005b124cd3 simplify error reporting 2014-08-05 23:02:15 -04:00
Erick Tryzelaar
14d2254b2b Remove unused macro 2014-08-05 22:41:27 -04:00
Erick Tryzelaar
00c01944cf add impls for {Hash,Tree}Sets 2014-08-04 16:53:21 -07:00
Erick Tryzelaar
6357c56674 implement Serializable/Deserializable for box types 2014-08-04 16:38:43 -07:00
Erick Tryzelaar
d689bc8b85 initial support for more full error messages 2014-08-03 12:35:15 -07:00
Erick Tryzelaar
499638eccd simplify deserializing a value from a primitive 2014-08-03 12:34:57 -07:00
Erick Tryzelaar
14d97f9c26 Cleaning up #[deriving_deserializable] 2014-07-27 20:16:18 -07:00
Erick Tryzelaar
4077d83cf2 Migrate over to cargo 2014-07-18 06:17:47 -07:00