Commit Graph

17 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
Lorenzo 4933019c44 Compat and BorrowCompat Debug and Display implementations (#670)
* feat: added Display and Debug implementations for Compat and BorrowCompat

* chore: added Compat and BorrowCompat Display and Debug tests

* chore: fixed imports and linter errors
2023-10-21 12:53:43 +02: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 974abe8661 Fixed the clippy Eq warning. (#574)
Added DecodeError::Io
Removed `PartialEq` on DecodeError
2022-08-18 15:57:18 +02:00
Trangar 86e03aeda7 Rewrite: seperated Decode and BorrowDecode (#526)
* Rewrite: seperated Decode and BorrowDecode

* Fixed cargo.toml issues

* Fixed clippy warning

* Removed the `impl_tuples` macro call with manually exported code

* Replaced the generated code in `impl_tuples` with the macro instead

* Implemented BorrowDecode for Box<[T]>

* Added a test to see if zoxide can be ported to bincode 2

* Added a test for Arc<str>

* Made several `Encode` implementations require `T: ?Sized`

* Implemented Decode for Arc<str>

* Added BlockedTODO links to commented out code

* Fixed clippy and lint issues

* Updated virtue dependency in fuzz lockfile
2022-06-04 15:23:55 +02:00
Lena Hellström f979383adb Fix tuple struct encoding in serde (#549) 2022-06-04 14:56:20 +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 03450ac49f Made config::standard() implement .write_fixed_array_header() by default (#509)
* Made config::standard() implement .write_fixed_array_header() by default

* Fixed failing unit test

* Fixed formatting
2022-02-28 17:26:46 +01: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 d13d177bea made the serde functions consistent with the base bincode functions (#483) 2022-01-19 18:57:52 +01:00
Trangar 59b787cbf8 Moved Configuration::standard() and ::legacy() to the config module (#481)
* Moved Configuration::standard() and ::legacy() to the config module

* Fixed issue with config that would overwrite the limit, added a checklist on adding config variables
2022-01-19 16:46:25 +01:00
Trangar 404946f12b [Breaking change] Made all `decode_from_slice` also return the number of bytes read (#445) 2021-12-11 15:51:50 +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
Victor Koenders 707d0d238f Made all encode and decode functions always require a Config, removed _with_config functions 2021-10-21 14:19:40 +02:00
Lena Hellström e232454936 Refactor and rename encoders 2021-10-17 16:22:14 +02:00
Trangar a27b63b7fa Make bincode_derive 0 dependencies (#409)
Removed `syn`, `quote` and `proc_macro2` dependency
2021-10-12 15:53:02 +02:00