27 Commits
Author SHA1 Message Date
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 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 93e2632000 Remove serde-byte-array 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
Robin Krahl df9e76b7bd Add test case for unknown fields 2025-06-04 21:35:35 +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
Robin Krahl 031c0b2029 Remove unnecessary lifetime annotations
This fixes a clippy lint.
2025-06-01 22:34:30 +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
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 cd7f1c9102 Use multiple lifetimes in test 2023-11-24 13:55:53 +01:00
Sosthène Guédonandsosthene-nitrokey 2eefedf15a Add tests from #1 2023-11-24 13:55:53 +01:00
Sosthène Guédonandsosthene-nitrokey 1d0c99e8a1 Add tests for zero-copy deserialization 2023-11-24 13:55:53 +01:00
Sosthène Guédonandsosthene-nitrokey 813c25b503 Simplify tests 2023-11-24 13:55:53 +01:00
Sosthène Guédonandsosthene-nitrokey 3a71998d07 Update heapless dev-dependency 2023-11-24 13:55:53 +01:00
Sosthène Guédonandsosthene-nitrokey dd33ec9572 Fix clippy warnings 2023-11-24 13:50:57 +01:00
Nicolas Stalder 9c3f28e825 Implement DeserializeIndexed for empty structs too 2020-03-27 02:59:27 +01:00
Nicolas Stalder 0e6a736b98 Fix the problem where struct keys could not be called "key" 2020-03-27 01:34:42 +01:00
Nicolas Stalder b641e54875 Minor changes 2020-01-13 00:02:19 +01:00
Nicolas Stalder 3a1bb45313 Implement offsets and skip_serialization_if 2020-01-12 02:53:02 +01:00