Commit Graph

144 Commits

Author SHA1 Message Date
Lena Hellström 2355e48a7b expose default options and serializers (#310)
Deprecate the old config system and make a refined version of the internal config system public. Doing allows the Serializer/Deserializer to be exposed since all of its generic type parameters are now public.
2020-04-16 15:23:07 -07:00
Lena Hellström 8839b0600d Modernize CI (#311)
Switches our CI from Travis-CI to Github Actions. At the same time this also turns on clippy and rustfmt linting.
2020-03-24 14:33:13 -07:00
Justin Starry 0215da2d29 Fix emscripten build failures due to lack of i128 support 2019-10-19 19:51:34 -04:00
alecmocatta 9d6e4f5ae6 Add tests 2019-09-06 17:38:28 -04:00
Diggory Hardy a04c750960 Make i128 support automatic for supporting Rustc versions
Uses autocfg
2019-01-28 09:59:18 -05:00
Ty Overby d8704644d7 format 2018-09-04 16:25:10 -07:00
boxdot 0e7b438bb4 Add tests for `Config::deserialize_seed`. 2018-09-04 16:22:50 -07:00
Ashley Mannix 2ef9a06894 add support for 128bit numbers 2018-05-30 09:44:38 -07:00
Ty Overby 76b7662dcd move to custom read implementation for deserialize_in_place 2018-02-07 19:39:27 -08:00
Ty Overby 68ca894b81 add deserialize_in_place 2018-02-07 18:32:10 -08:00
Ty Overby b31151a605 2nd implementation of the Config Trait (#214)
* add option and config traits

* thread options everywhere

* add WithOtherLimit, WithOtherEndian, and update internal to take advantage of it

* wip

* add rest of the public API and fix tests

* dtolnay feedback

* remove serialized_size_bounded and replace it with a use of config

* remove inline from trait method

* finish documentation and add custom reader support

* minor config_map refactor

* doc changes

* add with_(de)serializer functions and their associated modules
2018-02-07 18:26:46 -08:00
Markus Westerlind 7464ba7272 Allow serialized types to use a more compact representation ... (#217)
... by utilizing that bincode is not human readable.

Uses the changes in https://github.com/serde-rs/serde/pull/1044 which
allows data formats to report that they are not human readable. This
lets certain types serialize themselves into a more compact form as they
know that the serialized form does not need to be readable.

Closes #215

BREAKING CHANGE

This changes how types serialize themselves if they detect the
`is_human_readable` state.
2017-11-20 09:55:34 -08:00
Ty Overby 3a24da087b cargo fmt source 2017-10-13 08:57:04 -07:00
Ty Overby c8f02e30aa 177 invalid encodings (#212)
* split out invalid encoding errors

* detail breaking changes
2017-10-12 09:04:14 -07:00
Ty Overby 6692674f43 WIP Implement nocopy support for bincode (#150)
* basic infrastructure

* use BincodeRead internally

* fix zero copy behavior

* rearrange module layout; remove pub(crate)

* add size-limit safety checks when deserializing str or bytes

* fix-up tests
2017-04-20 18:27:22 -07:00
David Tolnay 7eccffd783 Update to serde 1.0 branch (#149)
* Update to serde 1.0 branch

* The serde 1.0 branch merged
2017-04-19 16:05:59 -07:00
Ty Overby 18cfe42d26 add more tests 2017-03-20 17:14:45 -07:00
Ty Overby 539637d78b remove refbox (#140) 2017-03-19 20:10:35 -07:00
Ty Overby f4c97fde6a make SizeLimit a trait (#124)
* make SizeLimit a trait

* move inline to the correct location
2017-03-17 17:59:12 -07:00
Ty Overby 1567d65ae9 fix oom 2017-02-24 19:04:46 -08:00
Ty Overby 1631cb2d80 Make Reader and Writer generic on Endianness (#103)
* Make Reader and Writer generic on Endianness

* make alternate API modules

* add test asserting that big endian encoding is different from little endian encoding

* clean up tests
2017-02-24 18:58:46 -08:00
Lena Hellström cac9301615 Remove InvalidEncoding struct (#111) 2017-02-10 10:19:58 -08:00
Lena Hellström ffbe4387dd Combine error types (#104)
* Combine error types

* Correct errors from merge conflict

* Create ErrorKind and Box it up

* Fix merge errors.

* Fix merge errors re-adding length encoding.
2017-02-09 23:07:20 -08:00
Ty Overby 19538cff29 Run tests on all channels (#108)
* Run tests on all channels

* try using travis.ci rust support
2017-02-03 09:54:39 -08:00
Lena Hellström 565b9c9f41 Remove length encoding (#102)
* Remove length encoding

* Improve bytes() test.
2017-02-03 09:27:03 -08:00
Ty Overby e7a74aa6c2 Remove rustc serialize support (#95)
* Remove rustc_serialize support

* Add changelist and bump version number for alpha

* Move refbox and friends into own module

* update changelog

* update travis config

* move serde functions out into global namespace
2017-01-31 15:50:55 -08:00
Lena Hellström c6393ac561 Update to serde 0.9.X (#93)
* Update to serde 0.9.X

* Remove redundant visitor and bad namespacing.

* Change DeserializeError to use Strings.

Reintroduce error tests.

* Better DeserializeError messages.

* Fix warnings.
2017-01-31 09:59:29 -08:00
David Tolnay 3d4346808f More efficient serialize_bytes (#90)
* Update to serde_derive

* Fix missing Encoder and Decoder imports

* Add test for serializing bytes

* More efficient serialize_bytes

Reported in #serde: blank_name2 tried serializing
`HashMap<String, HashSet<Bytes>>` vs `HashMap<String, HashSet<&Path>>`,
the `&Path` version was done in ~.6 seconds while the
`&[u8]` one took a full 3 seconds more.
2016-12-12 18:26:26 +00:00
Nikita Baksalyar 8d708cd194 Delegate emit_enum_struct_variant calls to emit_enum_variant (#89)
* Delegate emit_enum_struct_variant calls to emit_enum_variant

read_enum_struct_variant delegates calls to read_enum_variant which
expects u32 prefix to encode a variant number. Previous implementation
of emit_enum_struct_variant doesn't emit it, making serialized data
invalid.

* Add test to check manual enum encoding
2016-11-27 13:08:20 -08:00
Cobrand c5073e83e5 pub used InvalidEncoding in serde+rustc_serialize so it shows in `cargo doc` (#82)
* Removed unused import warning

* pub use InvalidEncoding in serde+rustc_serialize

* Made both fields of InvalidEncoding public so it can be used without Display or Debug traits (e.g. pattern matching)
* Export of InvalidEncoding in rustc_serialize/serde make them visible in `cargo doc`
2016-07-08 06:53:43 -07:00
Oliver Schneider 2eee182f1f fix char serialization and deserialization 2016-06-30 14:02:07 +02:00
Dmitry e5a524ed28 Fixed size array deserialization (#76)
* Attempt to implement hint for fixed size arrays.

* Removed wrong visitor + tests.

* Removed extra new line.
2016-06-19 13:29:10 -07:00
Ty Overby c819545c50 add more tests 2016-04-04 08:16:50 -07:00
Ty Overby bde9aa6565 add initial support for serde 0.7 2016-03-04 10:44:28 -08:00
Ty Overby 7662a57727 add more useful syntax error messages 2016-01-19 08:46:33 -08:00
Ty Overby 0cfb64511c moved the two designs into modules 2015-08-07 17:35:27 -07:00
Ty Overby 9c6bf1aa41 remove unused code 2015-08-07 16:39:15 -07:00
Ty Overby 3de218537f Fix test fallout during merge 2015-08-07 16:16:42 -07:00
Ty Overby 0c4403021d Merge branch 'serde3' of https://github.com/erickt/bincode into serde3 2015-08-07 15:14:38 -07:00
Ty Overby 022a9e6ed7 refactor test infrastructure 2015-08-07 15:14:20 -07:00
Erick Tryzelaar f04635c1ba Add newtype handlers to speed up parsing newtype structs and variants 2015-07-30 20:45:36 -07:00
Erick Tryzelaar 0d6b8a48b6 Get serde working 2015-07-29 13:15:04 -07:00
Erick Tryzelaar b206032ff1 Initial support for serde serialization 2015-07-01 15:21:26 -07:00
Erick Tryzelaar f11ba0c41f Move tests into the tests/ directory 2015-06-30 07:52:18 -07:00