Make 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).
Switch 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,
Document 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.
Complete 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:
before: codec::tests::bench_dec_hlist ... bench: 1817 ns/iter (+/- 43)
after: codec::tests::bench_dec_hlist ... bench: 995 ns/iter (+/- 27)
Checkpoint 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...
Use 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).
Replace 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`.
Update 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
Checkpoint 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.
Switch 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.