Commit Graph

118 Commits

Author SHA1 Message Date
Victor Koenders 254b87c6eb Moved all feature flags to src/features, made the CI run tests on all feature combinations 2021-09-22 16:23:27 +02:00
Lena Hellström 4b672de110 Enable non-slice readers 2021-09-22 15:08:52 +02:00
Victor Koenders 9c7fb85e0e Added support for slices, str, fixed size arrays. Added lifetime to Decode trait 2021-09-22 12:03:00 +02:00
Victor Koenders ffb565c405 Added config options for endian and int_encoding, added full coverage for all basic integer types 2021-09-22 10:40:27 +02:00
Victor Koenders ccca6ee49e Split Error into EncodeError and DecodeError 2021-09-19 10:52:21 +02:00
Victor Koenders 723bdd312a Turned Config::INT_ENCODING back into a const, made a ton of varint_encode functions 2021-09-19 09:25:47 +02:00
Victor Koenders bab0cf4bd1 Started working on bincode_derive 2021-09-13 13:20:47 +02:00
Lena Hellström b7c0d1fac0 reorganize de/enc modules 2021-06-20 00:12:10 +02:00
Lena Hellström e160c73acb a fresh new start 2021-06-19 19:31:34 +02:00
Lena Hellström e39a047b4b prep branch for 2.0 work (#379)
* prep branch for 2.0 work

* switch to 2018 edition

* fix clippy issues

* fix tests

* fix warnings

* fix formatting
2021-04-08 14:54:31 +02:00
Lena Hellström 810086e473 fix linting ci error (#377) 2021-02-23 12:09:15 -08:00
Andy Goetz 5d6dfa1fb9 Update docs to highlight differences between DefaultOptions and functions (#373)
Due to historical reasons, the default options used by bincode for the
helper functions at the root of the crate differ from the options in
the `config` module.

Changing the default options is a breaking change, so until a decision
is made, we can at least document the current behavior.
2021-02-23 05:33:55 -08:00
Lena Hellström 00c43bf3b1 fix logic error in fill_buffer (#336) 2020-06-23 23:41:55 -07:00
Lena Hellström a822c09d93 bump version to 1.3.0 (#330) 2020-06-04 21:20:43 -07:00
Lena Hellström 752262a03d update documentation to reflect new config options (#329) 2020-06-04 21:20:00 -07:00
Lena Hellström e80f61b9da Reject trailing bytes (#198) 2020-05-26 12:40:04 -07:00
Lena Hellström f9faa33686 refactor config module (#323)
Break up the config module into one submodule per configuration
option. This commit also changes the default configuration with
the new options system to be varint (the old system still uses
fixint to preserve backwards compatibility).
2020-05-18 22:46:12 -07:00
Lena Hellström c27e9c6874 Varint enum tags and lengths (#306)
Adds varint encoding to all numbers, including sequence lengths and enum discriminants. Varints are encoded according to the following scheme

1. If `u < 251`, encode it as a single byte with that value.
2. If `251 <= u < 2**16`, encode it as a literal byte 251, followed by a u16 with value `u`.
3. If `2**16 <= u < 2**32`, encode it as a literal byte 252, followed by a u32 with value `u`.
4. If `2**32 <= u < 2**64`, encode it as a literal byte 253, followed by a u64 with value `u`.
5. If `2**64 <= u < 2**128`, encode it as a literal byte 254, followed by a u128 with value `u`.

Signed integers are first encoded using zigzag format (see docs for details)

Co-authored-by: Maciej Hirsz <maciej.hirsz@gmail.com>
Co-authored-by: Nicole Mazzuca <nicole@strega-nil.co>
2020-05-18 17:07:10 -07:00
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
jean-airoldie e2d8742743 Add contraints to {Serializer,Deserializer}Acceptor
This allows the user to retreive concrete types from the
serializer & deserializer output.
2020-01-23 09:23:48 +00:00
David Tolnay 6c4b23ce62 Release 1.2.1 2019-12-09 22:25:24 -08:00
Justin Starry 0215da2d29 Fix emscripten build failures due to lack of i128 support 2019-10-19 19:51:34 -04:00
Josh Matthews 293e9cea32 Release 1.2.0. 2019-09-24 14:16:47 -04:00
Josh Matthews d4d13aa37c Release 1.1.5. 2019-09-23 18:56:44 -04:00
David Tolnay 18da2c95d5 Release 1.1.4 2019-05-14 21:16:49 -07:00
David Tolnay 107a1930b5 Update documentation to 2018 edition 2019-04-30 01:18:32 -07:00
David Tolnay c954d3352c Remove unneeded ```rust from rustdoc 2019-04-30 01:15:01 -07:00
David Tolnay 0a67cf66e7 Release 1.1.3 2019-04-07 17:28:48 -07:00
David Tolnay f5af5b992b Define html_root_url 2019-02-16 11:28:17 -08:00
Diggory Hardy a04c750960 Make i128 support automatic for supporting Rustc versions
Uses autocfg
2019-01-28 09:59:18 -05:00
Jeff Muizelaar 20da2c841a Make config() inline(always)
Without this we end up generating code for all configs unless LTO is on.
2018-11-20 11:13:44 -05:00
Ty Overby d8704644d7 format 2018-09-04 16:25:10 -07:00
Ashley Mannix 2ef9a06894 add support for 128bit numbers 2018-05-30 09:44:38 -07:00
Ty Overby 72f002cc0a some comment fixes 2018-02-13 16:24:57 -08:00
Ty Overby 5081ac7c08 remove unused function type parameter 2018-02-07 20:23:07 -08:00
Ty Overby 24b007e194 public but hidden read types 2018-02-07 20:13:26 -08:00
Ty Overby 3c5b38097f hide with_deserializer and with_serializer 2018-02-07 19:46:25 -08: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
Ty Overby 47b66f55ce switched type parameter on deserializer 2017-10-13 17:44:36 -07:00
Ty Overby 251bbe22d4 remove _types from read module 2017-10-13 17:42:09 -07:00
Ty Overby 40889ec016 capitalize Bincode 2017-10-13 17:38:36 -07:00
Ty Overby 3a24da087b cargo fmt source 2017-10-13 08:57:04 -07:00
Ty Overby d04ba007dc remove references to old type (#210) 2017-10-11 09:53:45 -07:00
Ty Overby 62941544ea rename doc functions (#208)
* fix up docs
2017-10-10 16:41:27 -07:00
Ty Overby ab70e7d507 remove completely unused dependency 2017-10-10 10:32:18 -07:00
Lena Hellström 34aba9acbe Internal type names (#199)
* Remove internal type names from api

* Rename IoReadReader to IoReader
2017-07-23 21:57:53 -07:00
Lena Hellström 18bcfc420e Seal SizeLimit and BincodeRead 2017-07-22 14:37:08 -05:00