Commit Graph

88 Commits

Author SHA1 Message Date
Lena Hellström 99de47a6c8 Reintroduce varint optimizations 2021-10-24 16:44:36 +02: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
Victor Koenders 151edf46d3 Included spec.md into cargo's documentation, fixed the issues, changed the [u8; N] implementations to [T; N] 2021-10-21 11:57:16 +02:00
Lena Hellström 684f2562b1 Config rewrite (#412)
Rewrite the config system to be slightly more friendly to adding new options
2021-10-17 21:07:31 +02:00
Victor Koenders 02a9b2cb71 Made the test stage throw an error on warnings 2021-10-17 17:23:28 +02:00
Lena Hellström e232454936 Refactor and rename encoders 2021-10-17 16:22:14 +02:00
Victor Koenders 61c1e8a7cd Added badges to the functions to indicate which features they require 2021-10-17 15:00:14 +02:00
Victor Koenders 1f261cede3 Added support for atomic integers 2021-10-16 14:49:18 +02:00
Victor Koenders 8ab730eb87 Added support for IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6 2021-10-16 14:28:06 +02:00
Victor Koenders a0469e08ef Added support for NonZero* types 2021-10-16 14:14:15 +02:00
Victor Koenders 9420d03762 Added support for Range<T>, RangeInclusive<T> and Bound<T> 2021-10-16 13:59:48 +02:00
Victor Koenders 26d7683719 Added support for Path and PathBuf 2021-10-16 13:47:48 +02:00
Victor Koenders acbd385649 Added core::time::Duration and std::time::SystemTime 2021-10-16 13:32:12 +02:00
Victor Koenders 9cf577d9bc Added support for String, Mutex<T> and RwLock<T> 2021-10-16 13:19:30 +02:00
Victor Koenders 33dd4f761d Added support for CStr and CString 2021-10-16 12:59:38 +02:00
Victor Koenders a322e0f1b3 Added support for BinaryHeap, BTreeMap, BTreeSet and VecDeque 2021-10-16 12:21:52 +02:00
Victor Koenders 4e1a72796c Added support for Cow, Rc and Arc 2021-10-16 12:08:29 +02:00
Victor Koenders 1d6379e715 Added support for Cell and RefCell 2021-10-16 12:04:23 +02:00
Victor Koenders 07f49e878e Added support for Vec<T>, Box<T> and Box<[T]> 2021-10-16 11:41:59 +02:00
Victor Koenders 82924aa96e Added support for Option<T> and Result<T, U> 2021-10-16 11:03:25 +02:00
Victor Koenders 960b6066cd Added an option to encode a fixed array length or to skip it 2021-10-14 21:31:47 +02:00
Victor Koenders 19fed15463 Added support for tuples with up to 8 values 2021-10-14 20:33:03 +02:00
Victor Koenders e4e12c984b Added support for the bool type 2021-10-14 19:34:35 +02:00
Victor Koenders c4cb220fb2 Added support for char encoding/decoding 2021-10-14 19:28:28 +02:00
Victor Koenders c969622384 Added alloc and std tests 2021-10-12 16:13:21 +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
Victor Koenders 8e99d580b8 Removed `allow` attributes, fixed some warnings 2021-09-26 09:19:39 +02:00
Lena Hellström 044942891f Clean up the borrow crimes 2021-09-22 22:17:26 +02:00
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
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
Lena Hellström c83c36333d Add enum encode/decode derive 2021-09-20 23:06:25 +02:00
Lena Hellström 2d0254405b Add derive support for tuple structs 2021-09-20 16:56:17 +02:00
Lena Hellström e414cabd33 Add derive for Decodeable 2021-09-20 16:35:36 +02:00
Lena Hellström 8241e6c656 Add generic bound support to derive 2021-09-20 16:27:13 +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 00c43bf3b1 fix logic error in fill_buffer (#336) 2020-06-23 23:41:55 -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
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