chore(deps): update rust crate bilrost-derive to 0.1014.0 #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.1010.2→0.1014.0Release Notes
mumbleskates/bilrost (bilrost-derive)
v0.1014.1Compare Source
New features
hashbrown 0.16v0.1014.0Compare Source
Breaking changes
There should be no breaking changes this release.
New features
enables oneof variants with any number of fields, encoding a sub-message as
the variant's value without a second struct type to nest as a value.
#[bilrost(reserved_tags(..))]attribute for theOneofderive macro as well.Enumerationderive macro now supportsTuple()andStruct { }variants as long as they have no fields.
empty variants.
Range<T>andRangeInclusive<T>, which encode and decodethe same as
(start, end)tuples.NonZerointeger types, which are considered non-empty.These types must be wrapped in an
Optionor another container to appear ina message field.
Fixes
fixed-size representation in the readme documentation.
Cleanups
v0.1013.0Compare Source
Breaking changes
For normal use
bugs and will be either fixed or documented in a patch release.
Advanced usage
Since 0.1012:
bilrost::encoding::Generalencoding type has become a specificdefinition of a generic type,
bilrost::encoding::GeneralGeneric<P>. Anythingthat implements encoders specifically for
Generalor sets up encodingdelegation for it may find that it no longer works inside nested values or in
Oneofvariants, since those values are encoded with a specific definition ofthe generic. If this is a problem, it can be solved one of two ways:
the "general" encoding, overriding "general_packed"
General, butfor
GeneralGeneric<P>for allconst P: u8instead; this will includeboth of the general encodings.
OpaqueMessage::{borrowed, convert_to_owned}toto_borrowedandinto_owned, andOpaqueValue::convert_to_ownedtointo_ownedto bettermatch common naming conventions
Vec<T>by delegating to"unpacked" when
Tis supported by the "fixed" encoding.second party implementations for third-party types.
impl Encoder<E> for Ttoimpl Encoder<E, T> for ().Since 0.1013.0-rc.4:
new_proxymethod from theProxiabletrait; theProxytypethat your type will be encoded as must have
ForOverwritein the encodingEthat is used to encode it instead.
New features
For normal use
Messagetrait now has the methodsnew_empty,message_is_empty, andclear_message. These provide the same functionality that was available byusing
EmptyStatefrom the advanced-usage space traits previously, but thattrait is no longer available to
dynmessages in a usable form.general_packed(exported asbilrost::encoding::GeneralPacked) that defaults to packed representationsrather than unpacked for its supported collection types.
general_packedis now the implicit default when no encoding is specifiedfor
Oneofvariants, as well as the default inner encoding for valuesnested inside
packed,unpacked, andmapvalues.general_packedshould behave the same asgeneral.explicit field
encoding. This can be very helpful as the compiler errormessages from the missing trait are unlikely to ever be very good.
#[bilrost(ignore)]attr, no longer always requirethe whole message struct to implement
Default; when the message struct isgiven the
#[bilrost(default_per_field)]attr, only the types of theindividually ignored fields need to implement
Default.Advanced usage
encoding_implemented_via_value_encoding!-- implements encoding/decodingfor message fields for all types where encoding/decoding of values is
available and the
EmptyStatetrait is implemented. Recommended forvirtually all encodings.
encoding_uses_base_empty_state!-- delegates allEmptyStateandForOverwriteimplementations to the "base" implementations used by theencodings in the
bilrostcrate. See the "proxy_own_type" example.implement_core_empty_state_rules!-- adds some covering implementationsof the
EmptyStateandForOverwritetraits for a custom encoding intendedto be used for types not owned by your crate. See the
"proxy_third_party_type" example.
Sizedconstraints have been relaxed on theEncoder,ValueEncoder,and
WireTypedtraits.patterns for implementing encoding & decoding types not naturally supported by
the
bilrostcrate, for cases when those types are and are not owned by yourown crate.
Fixes
empty_state_via_default!macro no longer produces malformed output whenused with a generic.
v0.1012.3Compare Source
Fixes
Option<T>that prevented borrow-onlytypes from being decodable when wrapped in
Option.v0.1012.2Compare Source
Fixes
the data in unknown fields that the mssage also contains.
v0.1012.1Compare Source
Fixes
empty_state_via_for_overwritemacro, which wasincompletely implemented and still referenced the
Defaulttrait.v0.1012.0Compare Source
Breaking changes
This release includes a major overhaul of encoding and decoding traits for
the library.
MessageMessageMessageOwnedMessageDistinguishedMessageDistinguishedOwnedMessageBorrowedMessage<'a>DistinguishedBorrowedMessage<'a>For very simple usage of the
bilrostlibrary, this will now probably meanimporting both
MessageandOwnedMessagetraits to have the desiredfunctionality in scope.
The
DistinguishedMessageandDistinguishedOneoftraits & derives are goneas well; rather than deriving multiple traits, simply add a
#[bilrost(distinguished)]attribute to the type being derived from:Message,DistinguishedMessageMessagewith#[bilrost(distinguished)]on the structOneof,DistinguishedOneofOneofwith#[bilrost(distinguished)]on the enumMessage&Oneofwith#[bilrost(distinguished)]on the enumMessage,Oneof, &EnumerationNew features
default and available in the derive macros. This decodes from a
&[u8]slicewith lifetime into messages that may reference its data.
&str,&[u8],&[u8; N], and&bstr::BStr; these types can appear in message fields, oneof fields, andnested in other containers just like any other type. This also adds
guaranteed behavior for
Cowfor these borrowed types also decodes asCow::Borrowed(&..)when decoding from borrowed data.decoding that each work slightly differently:
bytes::Bytesand into fields of typebytes::Bytesorbytestring::Bytestring. This yields owned, refcountedhandles to the original data.
&[u8]and into fields of type&str,&[u8],&[u8; N], or&bstr::BStr. This yields data borrowed for a lifetime atvery low cost, protected by the borrow checker rather than a refcount.
decoding impls for messages and oneofs is done only with
MessageandOneof, and distinguished implementations are switched on and off byattribute.
encodingmodule as the crateis getting closer to what could become a stable release.
From<Vec<u8>>andFrom<Box<[u8]>>impls forReverseBuffer.reserved_tagsattribute:5..and..=5.encoding type; see
encoding::{Proxied, Proxiable}for details.crate and to
bilrost(via type-tagged impls) and completely break theguarantees of the
bilrostlibrary. I do my best, but correctness is inyour hands!
Fixes
message decoding modes to return data or canonicity that is less than the
restriction level that was specified, if a decoding implementation returns a
lower canonicity but forgets to check against the restriction in the context.
The worst that should happen is that the error is raised late, at the end of
decoding, when it is too late to add information about the location of the
error. There are also debug-only assertions that test that this should never
happen, and explanatory documentation about exactly when a
Canonicityshouldbe checked against the restricted context on
RestrictedDecodeContext::check.checked very aggressively in all existing implementations, far more often
than it had to be.
Cleanups
modules etc.
encodingmodule.definitions fixed field tags so existing fuzzing corpora will be maximally
useful.
Decodertraits no longer accept aduplicatedboolean argument thatmandates returning an error when it is true. Instead, message implementations
that have defined fields are responsible for creating the
UnexpectedlyRepeateddecoding error themselves.v0.1011.2Compare Source
Fixes
the data in unknown fields that the mssage also contains.
v0.1011.1Compare Source
Fixes
their variants has a type with no "empty" state. 🎊
v0.1011.0Compare Source
Breaking changes
Oneoftraits now encode and decode slightly differently and the traitsbearing an empty state now have special responsibility for guarding against
value duplication and recording error locations.
RestrictedDecodeContext, which restricts the minimum tolerated canonicityand allows for early exits and detailed errors about the location of
non-canonical data problems.
DecodeContextnow has public method visibility.New features
core::time::Durationandstd::time::SystemTime.bstrcrate and itsBStringtype,which is a wrapper around
Vec<u8>that acts like text but does not guaranteeUTF-8 and does not require any validation.
chronoandtimecrates and most oftheir important types, available through new crate features.
Oneoftypes can now be wrapped inBox(multiple times even, and eitherside of
Optionif you really want.)DistinguishedMessage: added "restricted" and "canonical" decoding methodsalongside the existing "distinguished" ones, allowing decoding to stop early
on canonicity errors.
Fixes
PartialEqthat could potentially causecompilation failures when supported types in the program support cross-type
equality.
bilrost-derive: simplify some codegen to remove a needlesslet mutinderived decoding implementations.
Cleanups
bilrost-types: parsing fractional seconds with more than 9 digits nowsimply truncates instead of erring.
bilrost-types: parsing timestamps with "unknown local offset" timezones("-00:00") is now tolerated, since the timezone information is discarded
anyway.
bilrost-types: improved fuzzing binaries for datetime parsing.rustfmtandclippydevelop more and stronger opinions.
implementations and third-party types. All that code is now filed under
encoding::type_supportand conditionally enabled at the file level. Implsfor primitive and core types in the builtin encoders are still in those
encoders' modules, but the
value_traitsmodule now contains only traits andmacros and all conditionally-enabled code has been moved into
type_support.the newer, slightly more abstract encoding paths. These fuzzers are typically
run in the order of hundreds to thousands of CPU hours per significant change,
and are available for you to run as well.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.