Skip to content

Releases: mumbleskates/bilrost

v0.1008.0

18 May 17:25
Compare
Choose a tag to compare
v0.1008.0 Pre-release
Pre-release

v0.1008.0

Breaking changes

  • The (unstable) internal encoding traits continue to evolve, now making checks
    for whether a value decoded in distinguished mode was empty optional at the
    value-decoder trait level. It is not always faster to check emptiness while
    decoding a value, and letting the distinguished value decoder implementation
    specify whether it takes responsibility for checking emptiness enables new
    type support like better nesting of never-empty types as described below.

Fixes

  • Enumerations that do not have a defined zero value (and therefore do not have
    an "empty" state) can now be nested in fixed-size arrays as long as they are
    nested again, such as in an Option or Vec.

Cleanups

  • Renamed the NewForOverwrite value trait to ForOverwrite.
  • Restructured so that ForOverwrite is now a supertrait of EmptyState, and
    every existing implementation of EmptyState::empty defers to ForOverwrite.

v0.1007.0

01 May 22:03
Compare
Choose a tag to compare
v0.1007.0 Pre-release
Pre-release

v0.1007.0

Breaking changes

  • Tuple typed structs (with anonymous fields accessed like value.0) now start
    their field numbering from zero by default, matching the names of the fields.
  • Renamed the .reader() method on ReverseBuffer to .buf_reader() so it no
    longer conflicts with the bytes::Buf method.

New features

  • Added support for encoding usize and isize pointer-sized integers. They
    will still have different supported maximums on platforms with different sized
    values, but this still has completely reasonable failure modes.
  • Added support for deriving Message for enum types, which is implemented in
    terms of Oneof. The message implementations encode and decode exactly like a
    message which contains only that oneof; see the readme for more details.
  • Changed the Value type in bilrost-types to be a message-via-oneof in this
    way, making it much nicer to use without changing its meaning.
  • Added a .slices() method to ReverseBuffer and ReverseBufferReader which
    iterates its slices, useful for sending to write_vectored.

Fixes

  • Fixed some incorrect tests, including coverage of third-party inline vecs and
    packed/unpacked fixed-size arrays.

Cleanups

  • Cleaned up and re-added fuzzers! Fuzzers are available via both libfuzzer
    and afl; see FUZZING.md for usage details. These fuzzers
    would have caught the bug fixed in 0.1006.1 :)
  • Deduplicated and somewhat improved codegen for oneofs. All four kinds of oneof
    decoder function are now generated by the same code, which is a huge
    improvement over four independent generators.
  • Added tests for detailed errors attribution of decoding errors to the specific
    field that caused the problem.

v0.1006.0

15 Apr 03:18
Compare
Choose a tag to compare
v0.1006.0 Pre-release
Pre-release

v0.1006.0

Breaking changes

  • The (unstable) internal encoding traits continue to evolve, now varying the
    implementation of TagMeasurer and moving the "allow empty" argument of
    distinguished value decoding into a const generic param.

New features

  • Hash maps and hash sets can now have any kind of hasher, as long as the
    BuildHasher implements Default.
  • Plain tuples can now be encoded as message fields! Tuples encode exactly the
    same as messages with field tags 0 through N-1, but the encoding of each field
    in the tuple can be specified. See the readme for more information.
  • Fixed-size arrays ([T; N]) can now also be encoded as message fields. Arrays
    encode exactly the same as a collection like Vec would, except if each value
    in the array is empty the whole array is considered empty. When decoding an
    array, if a nonzero number of items is present and it is not the same number
    of items as the size of the array, the value and message being decoded are
    considered to be invalid.
  • A couple third-party alternative types for Vec that have bounded size and
    inline-only storage (ArrayVec from the arrayvec and tinyvec crates) have
    been added.
  • Third-party alternative types for Vec now also work with u8 items and the
    plainbytes encoding.

Fixes

  • Added a Self: Default bound to the impl for Message when there are ignored
    fields. This means that it can be possible to have a message type with ignored
    fields and generically typed fields that don't implement Default; rather
    than failing to compile, it will now simply not implement Message.

Cleanups

  • Consolidated (almost) all the standard impls of the EmptyState trait into
    the same module.

v0.1005.1

06 Apr 22:59
Compare
Choose a tag to compare
v0.1005.1 Pre-release
Pre-release

v0.1005.1

This release changes nothing, just fixes the link to the logo in the docs :)

v0.1005.0

06 Apr 22:59
Compare
Choose a tag to compare
v0.1005.0 Pre-release
Pre-release

v0.1005.0

Breaking changes

  • The (unstable) internal encoding traits continue to evolve, this time to
    support prepend-encoding.

New features

  • Added prepend-encoding: messages can be encoded to a prepend-only buffer, with
    .prepend(reverse_buf) or .encode_fast(). This encoding method writes
    messages in reverse, avoiding any need to "look ahead" in order to encode the
    correct length for data that is not yet written. This enables writing an
    arbitrarily nested message without visiting any field more than once, removing
    a quadratic hazard and general inefficiency in the encoding path.
  • New reserved_tags attribute on messages to prevent tags from being used,
    even by accident.
  • Both the new reserved_tags and the old oneof attributes can now specify
    inclusive ranges of tag numbers instead of only single tags. For now, in
    oneof this is limited to 100 tags per range because more than that is just
    too many.
  • bilrost-derive, which contains the derive macros, is now no_std. This
    doesn't really change what it's capable of at all but it does make it easier
    to prove it doesn't accidentally preclude using std.

Fixes

  • Explicitly instantiate and invoke the const-time assertions that check the
    tags match between a Oneof type and its inclusion in a Message. Before this
    the asserts probably would never run.

Cleanups

  • The "opaque" message types are now always available, and no longer require a
    dependency or a crate feature. The "opaque" feature will be removed in a
    future version.
  • The "derived message tests" have been moved from a binary with required
    features to an integration test. The "derive" feature and the "bilrost-derive"
    crate dependency are now always enabled in tests to support this.

v0.1004.0

04 Mar 07:03
Compare
Choose a tag to compare
v0.1004.0 Pre-release
Pre-release

v0.1004.0

Breaking changes

  • The "encoder" attribute for message & oneof fields is now "encoding". This
    reads better and makes more sense, better to do it now.
  • Conversion to & from u32 now uses the Enumeration trait rather than
    Into<u32> and TryFrom<u32>.
  • The "opaque" types, bilrost::encoding::opaque::{OpaqueMessage, OpaqueValue}
    now use Cow under the hood instead of Vec, allowing them to hold borrowed
    data rather than only owned.

New features

  • There is now an Enumeration trait for converting to & from u32 from
    derived enumerations.

Fixes

  • Fixed some incorrect documentation.

Cleanups

  • Large refactor that changes the underlying Encoder traits from
    impl Encoder<Value> for Encoding to impl Encoder<Encoding> for Value. This
    avoids issues with a new "non_local_definitions" lint which fires when trait
    implementations are derived for a function-local type.

v0.1003.1

25 Feb 08:41
Compare
Choose a tag to compare
v0.1003.1 Pre-release
Pre-release

v0.1003.1

Fixes

  • Fixed some incorrect documentation.

v0.1003.0

25 Feb 07:56
Compare
Choose a tag to compare
v0.1003.0 Pre-release
Pre-release

v0.1003.0

Breaking changes

  • Removed the recently added RequireCanonicity trait and fold its
    functionality into WithCanonicity now that we figured out how to spell that.

Fixes

  • WithCanonicity::canonical_with_extensions no longer swaps the meaning of
    Canonical and NotCanonical.
  • More aggressive inlining for very hot functions may increase encoding/decoding
    performance significantly.
  • Decoding messages with mixed packed and unpacked representations in the same
    field is now always an error, regardless of what order they appear in. This
    was formerly a constraint of the way unpacked fields were decoded.

Cleanups

  • The readme is feature-complete!

v0.1002.1

23 Feb 20:38
Compare
Choose a tag to compare
v0.1002.1 Pre-release
Pre-release

v0.1002.1

Fixes

  • WithCanonicity::canonical_with_extensions and
    RequireCanonicity::allow_extensions no longer swap the meaning of
    Canonical and NotCanonical.

v0.1002.0

23 Feb 20:38
Compare
Choose a tag to compare
v0.1002.0 Pre-release
Pre-release

v0.1002.0

Breaking changes

  • Distinguished decoding traits now still succeed without error when decoding
    non-canonical data, but additionally return information about the canonicity
    of the message. The three levels of canonicity are "Canonical" (the only level
    that was accepted previously), "HasExtensions" (all known fields are
    canonical, but there are unknown fields), and "NotCanonical" (known fields
    have non-canonically represented values).
  • As part of fixes and expansions to traits and requirements to allow Message
    and DistinguishedMessage to be object-safe with full functionality,
    MessageDyn and DistinguishedMessageDyn have been removed.

New features

  • The Canonicity enum has been introduced at the crate level, returned as
    additional information by distinguished decoding traits.
  • Since distinguished encoders now return Result<Canonicity, DecodeError>
    or Result<(T, Canonicity), DecodeError>, new helper traits have been added
    to allow converting this information into errors when it is
    unacceptable: WithCanonicity and RequireCanonicity.

Fixes

  • Object-safe traits were broken and unfun to use. They've been implemented in a
    much more correct way now.
  • Derived Enumeration types now convert via TryFrom<u32, Error = u32> instead
    of Error = DecodeError. The old implementation wasn't really helping anyone
    by discarding the untranslated value.

Cleanups

  • Significant readme expansion and organization.