Rust Commons
  1. Rust Commons

rcodec

Public

Commits

AuthorCommitMessageCommit DateIssues
Chris CampbellChris Campbell
451bc0aaf7eMMerge branch 'feature/impl-trait'
Chris CampbellChris Campbell
0e88f86991dFix signature of `hlist_flat_prepend_codec` so that it no longer requires the function to return a boxed Codec. Also, remove some boxing that is no longer necessary as a result of that change.
Chris CampbellChris Campbell
cabc2a4f365Make use of the new conservative `impl Trait` feature available in the latest Rust nightlies. This allows us to (FINALLY) reduce the visibility of the various combinator implementations (making them module-private instead of `pub`, and removing the #[doc(hidden)] workaround).
Chris CampbellChris Campbell
6e3cf525a93Use a slightly simplified complex example for the README.
Chris CampbellChris Campbell
98fb2e9c561Add LICENSE along with basic README.md file.
Chris CampbellChris Campbell
33917abcfd0Drop the hlist sources from this repo and instead point to the new hlist-rs repo.
Chris CampbellChris Campbell
d9e65fa1922Move hlist module and the HListSupport plugin to a separate tree. Eventually they will be moved into a separate repo.
Chris CampbellChris Campbell
da4ee767299Add configuration files for Atom Build support.
Chris CampbellChris Campbell
b4b76440dcaVarious small fixes to account for Rust API changes made over the past few months (especially on the plugin side). Things are now working again when built against latest (1.12) nightlies.
Chris CampbellChris Campbell
8e0c94ee5c2Switch back to defining integral codecs as statics. Performance should be about the same either way due to inlining, but with statics we can reduce parenthesis noise (although with lowercase names we go against usual Rust code style for globals, oh well).
Chris CampbellChris Campbell
42e783e4471Drop the IntoCodec trait and instead just provide default impls of Codec trait for Box<Codec> and &'static Codec.
Chris CampbellChris Campbell
c1b73a13e28Fix various small things to get it working with latest rust nightlies.
Chris CampbellChris Campbell
cfa632fb529MMerge branch 'back-to-the-stack-take-2'
Chris CampbellChris Campbell
a4a9a68d99aFix read() logic for nested views. This fixes the issue uncovered in the previous commit where decoding would fail for the example in the hcodec! macro documentation.
Chris CampbellChris Campbell
21d66d4e7bfDocument all the things. One exception is the codec implementation structs, which have been hidden from the docs since they are not generally useful. In adding examples to the macro documentation, I discovered an apparent bug with hcodec! when a drop left is involved. This will be addressed separately.
Chris CampbellChris Campbell
1a132297a3aUse quote_expr! instead of quote_tokens!. This is more correct since the content resolves to an expression, and it also avoids a spurious warning.
Chris CampbellChris Campbell
e728625be93We no longer have static codec references.
Chris CampbellChris Campbell
5cb6d9d9480Clarify comments.
Chris CampbellChris Campbell
cbb7e2a78f1Remove workaround now that record_struct! correctly handles parameterized types.
Chris CampbellChris Campbell
fff014190ffSplit AsHList into separate FromHList, ToHList, and IntoHList traits.
Chris CampbellChris Campbell
add828c7632Add benchmark for complex codec.
Chris CampbellChris Campbell
ea7412dee3bUpdate integration tests to work with the latest Codec API changes.
Chris CampbellChris Campbell
13f92e8667cComplete the work on HListFlatPrependCodec. All functions are now reimplemented in the new style and all tests are passing. Additionally, the hlist codec benchmarks are showing nice performance gains due to a reduction in unnecessary boxing and indirection: Decoding: before: codec::tests::bench_dec_hlist ... bench: 1817 ns/iter (+/- 43) after: codec::tests::bench_dec_hlist ... bench: 995 ns/iter (+/- 27) Encoding: before: codec::tests::bench_e...
Chris CampbellChris Campbell
521c19ac549Checkpoint work on a new typing approach based on std::iter module. This makes heavier use of associated types, which in some cases is easier to read, and in others is harder to read. The downside is that we now return explicitly typed struct values instead of the previous approach where we returned a trait object (RcCodec<T>), which also means we need to make the struct definitions public. Not ideal, but it's sort of the way of the Rust. The upside is that we can keep pretty much all the...
Chris CampbellChris Campbell
6d44585d3a3Rename byte_vector creation functions and add a variant that consumes a Vec instead of cloning.
Chris CampbellChris Campbell
0ae8dcd5615Remove the unnecessary copy step. We can read directly into the value using a mutable pointer/ref.
Chris CampbellChris Campbell
628b346af1dUse unsafe memory copy to speed up (and simplify) integral decoder. The int decoder benchmarks show roughly a 20% performance improvement (84 ns/iter vs 110 ns/iter).
Chris CampbellChris Campbell
72021026f6cUse unsafe memory copy to speed up integral encoder. This also adds a new direct() function for creating a ByteVector that consumes a [u8] so that we can bypass Vec entirely. The int encoder benchmarks show roughly a 2x performance improvement (35 ns/iter vs 75 ns/iter).
Chris CampbellChris Campbell
87379dc485cAdd some codec benchmark tests so that we have a baseline for performance work.
Chris CampbellChris Campbell
8a643bcf643This thing isn't recursive any longer.
Chris CampbellChris Campbell
56a64a08699MMerge branch 'hlist-support-syntax-extension'
Chris CampbellChris Campbell
5c2232b2f1cReplace record_struct! procedural macro with an `AsHList` syntax extension. This allows us to generate an AsHList implementation for any struct, not just those generated by the record_struct! macro.
Chris CampbellChris Campbell
58a61dfb1b3MMerge branch 'master' into hlist-support-syntax-extension
Chris CampbellChris Campbell
d7c0c46e43fReplace uses of deprecated std::num module with types from num crate. This fixes the remaining deprecation warnings and also has the upside of giving us an Unsigned trait that we can use to restrict the type of the length codec for `variable_size_bytes`.
Chris CampbellChris Campbell
74eb41244aaWork around issues with operator overloading by handling context injection inside the hcodec! macro.
Chris CampbellChris Campbell
8ef4ab0c3aeUpdate code to work with latest nightly builds. Code that makes use of the `|` operator has been commented out temporarily while we find a workaround for some compiler limitations. There are still some deprecation warnings related to use of the Int trait; those will be fixed separately.
Chris CampbellChris Campbell
f9a59c6b38dFix copy_memory() calls, as the order of the arguments was swapped in a recent change.
Mike AshMike Ash
a6568333995MMerge branch 'bytevector-file'
Chris CampbellChris Campbell
46e7544645ds/assert_round_trip_bytes/assert_round_trip/
Chris CampbellChris Campbell
bf83f1ce3d3Flesh out the complex codec example using flat_prepend and the new eager codec.
Chris CampbellChris Campbell
095444a940fAdd an eager bytes codec.
Chris CampbellChris Campbell
523df70ee25Implement ByteVector::to_vec().
Chris CampbellChris Campbell
fefd60b58e5Use forcomp! macro and friends to simplify error handling ever so slightly.
Chris CampbellChris Campbell
2945b566fccCheckpoint work on a syntax extension that allows for derivation of to/from_hlist() on arbitrary structs. In theory this would be more flexible than the existing record_struct! macro, but writing a custom syntax extension is a nightmare, and I'm not sure it's really worth it in the end. Shunting this off to a separate branch in case we have the time and energy to finish it.
Mike AshMike Ash
b466fc1bed2Add a file-based backing store for ByteVector.
Chris CampbellChris Campbell
0f195fbae0bSwitch to having all functions return a reference-counted Codec<T> to allow for easier sharing of common codecs. There is an unfortunate extra level of indirection here (with Box) that can hopefully be removed once the compiler supports dynamically-sized types in Rc.
Chris CampbellChris Campbell
b7585b4fb9aUpdate test to use less-than-ideal solution for including a codec multiple times inside another codec.
Chris CampbellChris Campbell
967c0568e25Add an integration test involving complex codecs and nested structs.
Chris CampbellChris Campbell
64d7f89b7f8Add support to hcodec! macro for using >>= operator as a shortcut to hlist_flat_prepend_codec.
Chris CampbellChris Campbell
df9bb087032Implement hlist_flat_prepend_codec() function.