Commit Graph

12 Commits

Author SHA1 Message Date
Lena Hellström 2c87442fe6 Decode context (#749)
Add an optional context for decoding allowing additional data to be passed to decoded structs.

---------

Co-authored-by: branchseer <dk4rest@gmail.com>
2025-03-06 09:54:43 +00:00
Lena Hellström c02d52068e make serde decode api consistent (#748) 2025-03-03 12:16:45 +00:00
Bogdan Opanchuk 8e86cdfdd4 Expose types implementing `serde::Serializer` and `Deserializer` (#729)
* Expose types implementing serde::Deserializer

* Gate IoReader import
2025-03-02 20:34:18 +01:00
Trangar f98bc70757 Fix CI and clippy (#747)
* Fix CI and clippy

* Fix CI

* Disable code coverage
2025-03-02 16:48:16 +01:00
Trangar fb2c928c70 Fix inconsistent naming between serde and non-serde functions (#671)
* Fix inconsistent naming between serde and non-serde functions

* Updated references from old deprecated function

---------

Co-authored-by: Victor Koenders <git@trang.ar>
2023-10-15 15:03:09 +02:00
Trangar dc468b4bed Made arrays never encode their length (#625)
* Made arrays with 32 elements or less never encode their length

* Removed `write_fixed_array_length` and `skip_fixed_array_length` as this was based on incorrect assumptions on how serde and bincode 1 works

---------

Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
2023-03-30 15:09:33 +02:00
Gino Valente c179d2de69 Allow decode with custom DeserializeSeed (#586) 2022-10-02 11:35:16 +02:00
Trangar e7d2292dc2 Switched to weak dependencies (#538)
* Switched to weak dependencies

* Removed old `serde_impl` references

* Fixed CI and updated documentation

* Fixed a cfg for a test

* Removed unneeded package in Cargo.toml
2022-05-21 14:19:13 +02:00
Trangar 58dc788dfa Fix/issue 500 (#503)
* Fixed an issue where serde would decode a sequence with an u32 instead of a usize

* Added serde to the `the_same` test for roundtrips, fixed several issues.

* Fixed backwards compatibility for result, ipv4addr and ipv6addr

* Processed feedback
2022-02-07 16:52:15 +01:00
Trangar fc1f3acdcb Feature/improve serde (#477)
* Made serde able to be used with alloc and no_std targets

* Processed feedback
2022-01-19 18:14:21 +01:00
Trangar ad7ddebff3 Allow serde types to be Decode/Encoded (#434)
* Added support for #[bincode(serde)] attribute on fields, added SerdeToBincode helper struct

* Switch to using Compat/BorrowCompat

* Moved all the serde features and functions to its own module

* Fix broken link

* Added support for the bincode(with_serde) attribute in enum variants

* Updated the main documentation on serde, fixed an example not compiling under certain feature flag combinations

* Added #[serde(flatten)] to the list of problematic attributes

* Added better error reporting on invalid attributes
2021-11-09 10:08:47 +01:00
Trangar 8c1279feab functions to enable encoding/decoding serde types (#422)
* functions to enable encoding/decoding serde types
* Removed dev feature I forgot to remove
* Centralized option variant and len() decoding/encoding
2021-11-08 12:38:29 +01:00