34 Commits
Author SHA1 Message Date
Robin Krahl fc1370f179 Update docs for new attributes 2025-06-06 10:13:39 +02:00
Robin Krahl 6e09ecf58b Don’t require explicit index for skipped fields
This patch allows for fields that are always skipped to not have an
explicit index attribute so that users don’t have to assign bogus
indices that are never used.
2025-06-06 10:05:07 +02:00
Robin Krahl 07586dba9e Add index attribute for explicit index assignment
Fixes: https://github.com/trussed-dev/serde-indexed/issues/17
2025-06-05 11:29:55 +02:00
Robin Krahl 3deb892485 parse: Move field parsing into separate method 2025-06-05 11:29:55 +02:00
Robin Krahl 504b48cc92 Require auto_index attribute to enable automatic index assigment
Automatically assigning indices based on the order of the fields is
error prone, for example when used with feature flags, when fields are
skipped or when the fields of the struct are changed or reordered.
With this patch, we require an explicit opt-in to this potentially
problematic behavior.  See also:
     https://github.com/trussed-dev/serde-indexed/issues/17
2025-06-05 11:29:53 +02:00
Sosthène Guédonandsosthene-nitrokey 7920bfe31a Use spans for the fields implementations 2025-06-05 10:42:07 +02:00
Sosthène Guédonandsosthene-nitrokey fea4ec3c61 Fix clippy warnings 2025-06-05 10:42:07 +02:00
Sosthène Guédonandsosthene-nitrokey 1e3316681d Rename everything to prevent conflicts 2025-06-05 10:42:07 +02:00
Sosthène Guédonandsosthene-nitrokey 3f215c3fcb Support generics in serialize_with 2025-06-05 10:42:07 +02:00
Sosthène Guédonandsosthene-nitrokey a632293e8e Implement serde(with = "…") 2025-06-05 10:42:07 +02:00
Sosthène Guédonandsosthene-nitrokey a7f9c680fa Implement deserialize_with 2025-06-05 10:42:07 +02:00
Sosthène Guédonandsosthene-nitrokey 1ba7e85dfc Implement serialize_with 2025-06-05 10:42:07 +02:00
Sosthène Guédonandsosthene-nitrokey 431df81340 Parse (de)serialize_with attributes 2025-06-05 10:42:07 +02:00
Alfie FrestaandRobin Krahl 505df8957b Allow unexpected fields 2025-06-04 21:29:55 +02:00
Sosthène Guédon 432a7a26ed Rename Skip::None to Skip::Never 2025-06-02 11:03:03 +02:00
Sosthène Guédon cfe2dafe5e Allow skipping incrementing when using skip 2025-06-02 10:58:20 +02:00
Sosthène Guédon 6c2e0be1f9 Add support for serde(skip) 2025-06-02 10:58:20 +02:00
Sosthène Guédon ac81337193 Add support for serde(skip) in skip_serializing_if 2025-06-02 10:57:58 +02:00
Sosthène Guédonandsosthene-nitrokey bec7429f8b Fix #2
This patch adds tests based on `serde_test`. These tests helped showcase
the bug that leads to https://github.com/trussed-dev/serde-indexed/issues/2
2025-05-26 10:52:00 +02:00
Sosthène Guédonandsosthene-nitrokey 7a344caa11 Add full support for generics 2025-05-26 10:52:00 +02:00
Sosthène Guédonandsosthene-nitrokey a0186f4a63 Keep full generics data 2025-05-26 10:52:00 +02:00
Robin Krahl 1f4f26a23d Remove unused fields and lifetimes
This fixes some compiler warnings and clippy lints.
2025-02-17 00:00:02 +01:00
Sosthène Guédonandsosthene-nitrokey c828e834e7 Use proper spanned errors 2023-11-24 14:24:23 +01:00
Sosthène Guédonandsosthene-nitrokey a3f16a3bf2 Migrate to syn2 2023-11-24 14:24:23 +01:00
Sosthène Guédonandsosthene-nitrokey b1c9c6e92c Simplify lifetime management 2023-11-24 13:55:53 +01:00