Alpha Release v0.5.0 #46
jngls
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
<A>instead of<T, D>Expand<T, D>is a method which describes the v0.4.0 dilation implementation - the inner type adapts to the combination of T and D, choosing the smallest type that would contain all bits of the outer type D-dilated. There are naturally a limited number of T and D combinations available as the the largest integer type supported isu128Fixed<T, D>is a method adapter which describes the pre-0.4.0 dilation implementation - the inner type is the same as the outer type and a limited subset of bits in the outer type can be dilated. This is useful when you want absolute control over the inner type used and want to fit as many dilated bits into the inner type as possible.DilationMethod::UNDILATED_BITSand the maximum dilated value is given byDilationMethod::DILATED_MAX(formerly theDilatedMasktrait which was discarded in favour of constants closely mimicking the rust standardT::BITSandT::MAX).From. The use cases ofFromdo not accurately convey what is happening when converting to and from dilated integers. Users should now use the explicitregular_uint.dilate_expand::<D>()orregular_uint.dilate_fixed::<D>()anddilated_int.undilate()methods. Note thatregular_uint.dilate_expand::<D>()returns aDilatedInt<Expand<T, D>>,regular_uint.dilate_fixed()returns aDilatedInt<Fixed<T, D>>anddilated_int.undilate()returns a the original type of the uintT.Migration Notes
DilatedIntnow takes a DilationMethod adapter<A>in place of<T, D>. This is to allow for different formats of dilation. The 0.4.0 behaviour may be implemented usingDilatedInt<Expand<T, D>>. The old pre-0.4.0 behaviour may be implemented usingDilatedInt<Fixed<T, D>>.regular_uint.dilate_expand::<D>()orregular_uint.dilate_fixed::<D>()anddilated_int.undilate()methods. This is because use cases of the From impls are extremely hard to read at a glance. Explicit methods better show what is happening.Full Changelog: v0.4.0...v0.5.0
This discussion was created from the release Alpha Release v0.5.0.
All reactions