Commit Graph
20 Commits
Author SHA1 Message Date
Hugo Duncan 801f37b305 Fix visitors for generic structs 2015-05-14 17:35:21 -04:00
Hugo Duncan bdec0b3e63 Update commas and blocks in match arms 2015-05-14 17:35:16 -04:00
Hugo Duncan ec483fc07d Add doc string for format method 2015-05-08 12:43:12 -04:00
Hugo Duncan 53e6e29571 Fix whitespace 2015-05-08 12:43:12 -04:00
Hugo Duncan c5eed99c6a Make forwarded trait name global 2015-05-08 12:43:12 -04:00
Hugo Duncan fe5176113b Add missing attr.rs file 2015-05-08 12:43:12 -04:00
Hugo Duncan 0f7c67efa7 Factor default attribute lookup into FieldAttrs 2015-05-08 12:43:12 -04:00
Hugo Duncan cd0ee64892 Add constructor functions for FieldAttrs 2015-05-08 12:43:12 -04:00
Hugo Duncan ec3af2cb6a Factor out attr module
Factors out field attribute code into the attr module.
2015-05-08 12:43:12 -04:00
Hugo Duncan 960b68937d Remove commented code and extra newline 2015-05-08 12:43:12 -04:00
Hugo Duncan a1e101b513 Make Value use the 'json' format string 2015-05-08 12:43:11 -04:00
Hugo Duncan c30311153c Rename fmt to format 2015-05-08 12:43:11 -04:00
Hugo Duncan a935ebe8b9 Adds serializer format specific field names
Allows different field names to be used for different external formats.

Field names are specified using the `rename` field attribute, e.g:

    #[serde(rename(xml= "a4", json="a5"))]

Reverts #62

Addresses #61
2015-05-08 12:43:11 -04:00
Hugo Duncan fd6462f8d1 Add serialize, deserialize specific rename
Adds the rename_serialize and rename_deserialize field attributes to
specify serialisation and deserialisation specific renames.
2015-04-21 17:58:18 -04:00
Hugo Duncan 3e63d34c00 Mark serde field attributes as used
Prevents unused attribute warnings in code that marks fields with
field level #[serde] attributes.
2015-03-19 11:04:08 -04:00
Hugo Duncan 3c4eddc7f8 Fix plugin use of de::SeqVisitor
When compiling a module with a struct containing a derive_deserialize
annotation, the compiler was complaining "Use of undeclared type or
module `de`".
2015-03-04 17:40:45 -05:00
Hugo Duncan 1c0a16f719 Add aliases on struct fields
Allow specification of an alias on a struct field with
the #[serde(alias="SomeAlias"] attribute.

Addresses #13
2015-03-02 17:20:23 -05:00
Hugo Duncan bb1a9b2389 Add serde default attribute for fields
When annotated with #[serde(default)], a field gets a default value
using std:default::Default, and will not error when decoding if the
field is missing from the input.

Addresses #9

Refactor default_value to use if-let
2015-03-02 17:20:22 -05:00
Hugo Duncan c5a35e388c Refactor default_value to use if-let 2015-02-20 13:59:14 -05:00
Hugo Duncan b6fc68c030 Add serde default attribute for fields
When annotated with #[serde(default)], a field gets a default value
using std:default::Default, and will not error when decoding if the
field is missing from the input.

Addresses #9
2015-02-20 13:18:09 -05:00