sized-chunks
Efficient sized chunk datatypes
0.7.0
45M downloads/mo
#1302 most downloaded on crates.io
bodil/sized-chunks
What this package is like to depend on
Last release 4 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 13 months
Nearly every release is documented
notes for 20 of 20 stable releases
2 versions withdrawn
withdrawn after publishing
8 years old
22 releases · first in 2019
0 releases in the last 12 months
see the full history below
Release timeline
22 releases · Feb 2019 to Apr 2022
2020
2021
2022
2023
2024
2025
2026
Releases
latest 22-
0.7.029 Apr 2022Release notes
Open source →CHANGED
- Switched to const generics instead of the
typenumcrate. Rust 1.51 or later is required.
Release notes
Open source →CHANGED
- Switched to const generics instead of the
typenumcrate. Rust 1.51 or later is required.
- Switched to const generics instead of the
-
0.6.516 Apr 2021Release notes
Open source →FIXED
- When
InlineArraycannot hold any values because of misalignment, report it as capacity 0 instead of panicking at runtime. (#22)
Release notes
Open source →FIXED
- When
InlineArraycannot hold any values because of misalignment, report it as capacity 0 instead of panicking at runtime. (#22)
- When
-
0.6.417 Feb 2021Release notes
Open source →FIXED
InlineArraycan be used in recursive types again.
CHANGED
InlineArray::new()now panics when it can't store elements with large alignment (this was UB prior to 0.6.3). Alignments ofusizeand smaller are always supported. Larger alignments are supported if the capacity-providing type has sufficient alignment.
Release notes
Open source →FIXED
InlineArraycan be used in recursive types again.
CHANGED
InlineArray::new()now panics when it can't store elements with large alignment (this was UB prior to 0.6.3). Alignments ofusizeand smaller are always supported. Larger alignments are supported if the capacity-providing type has sufficient alignment.
-
0.6.314 Feb 2021Release notes
Open source →FIXED
- Multiple soundness fixes:
InlineArrayhandles large alignment, panic safety inChunk'scloneandfrom_iter, capacity checks inunit(),pair()andfrom(). InlineArraycan now handle zero sized values. This relies on conditionals in const functions, a feature which was introduced in Rust 1.46.0, which means this is now the minimum Rust version this crate will work on.
Release notes
Open source →FIXED
- Multilple soundness fixes:
InlineArrayhandles large alignment, panic safety inChunk'scloneandfrom_iter, capacity checks inunit(),pair()andfrom(). InlineArraycan now handle zero sized values. This relies on conditionals in const functions, a feature which was introduced in Rust 1.46.0, which means this is now the minimum Rust version this crate will work on.
- Multiple soundness fixes:
-
0.6.215 May 2020Release notes
Open source →FIXED
- This release exists for no other purpose than to bump the
refpooloptional dependency.
Release notes
Open source →FIXED
- This release exists for no other purpose than to bump the
refpooloptional dependency.
- This release exists for no other purpose than to bump the
-
0.6.126 Mar 2020Release notes
Open source →ADDED
- The crate now has a
stdfeature flag, which is on by default, and will make the crateno_stdif disabled.
FIXED
- Fixed a compilation error if you had the
arbitraryfeature flag enabled without theringbufferflag.
Release notes
Open source →ADDED
- The crate now has a
stdfeature flag, which is on by default, and will make the crateno_stdif disabled.
FIXED
- Fixed a compilation error if you had the
arbitraryfeature flag enabled without theringbufferflag.
- The crate now has a
-
0.6.024 Mar 2020Release notes
Open source →CHANGED
RingBufferand its accompanying slice typesSliceandSliceMutnow implementArrayandArrayMutfromarray-ops, giving them most of the methods that would be available on primitive slice types and cutting down on code duplication in the implementation, but at the price of having to pullArrayet al into scope when you need them. Because this means adding a dependency toarray-ops,RingBufferhas now been moved behind theringbufferfeature flag.ChunkandInlineArraydon't and won't implementArray, because they are both able to implementDeref<[A]>, which provides the same functionality more efficiently.
ADDED
- The
insert_fromandinsert_orderedmethods recently added toChunkhave now also been added toRingBuffer. RingBuffer'sSliceandSliceMutnow also have the threebinary_searchmethods regular slices have.SparseChunk,RingBuffer,SliceandSliceMutnow have unsafeget_uncheckedandget_unchecked_mutmethods.PartialEqimplementations allowing you to compareRingBuffers,Slices andSliceMuts interchangeably have been added.
FIXED
- Fixed an aliasing issue in
RingBuffer's mutable iterator, as uncovered by Miri. Behind the scenes, the full non-fuzzing unit test suite is now able to run on Miri without crashing it (after migrating the last Proptest tests away from the test suite into the fuzz targets), and this has been included in its CI build. (#6)
Release notes
Open source →CHANGED
RingBufferand its accompanying slice typesSliceandSliceMutnow implementArrayandArrayMutfromarray-ops, giving them most of the methods that would be available on primitive slice types and cutting down on code duplication in the implementation, but at the price of having to pullArrayet al into scope when you need them. Because this means adding a dependency toarray-ops,RingBufferhas now been moved behind theringbufferfeature flag.ChunkandInlineArraydon't and won't implementArray, because they are both able to implementDeref<[A]>, which provides the same functionality more efficiently.
ADDED
- The
insert_fromandinsert_orderedmethods recently added toChunkhave now also been added toRingBuffer. RingBuffer'sSliceandSliceMutnow also have the threebinary_searchmethods regular slices have.SparseChunk,RingBuffer,SliceandSliceMutnow have unsafeget_uncheckedandget_unchecked_mutmethods.PartialEqimplementations allowing you to compareRingBuffers,Slices andSliceMuts interchangeably have been added.
FIXED
- Fixed an aliasing issue in
RingBuffer's mutable iterator, as uncovered by Miri. Behind the scenes, the full non-fuzzing unit test suite is now able to run on Miri without crashing it (after migrating the last Proptest tests away from the test suite into the fuzz targets), and this has been included in its CI build. (#6)
-
0.5.311 Mar 2020Release notes
Open source →FIXED
- Debug only assertions made it into the previous release by accident, and this change has been reverted. (#7)
Release notes
Open source →FIXED
- Debug only assertions made it into the previous release by accident, and this change has been reverted. (#7)
-
0.5.210 Mar 2020 withdrawnRelease notes
Open source →ADDED
Chunknow has aninsert_frommethod for inserting multiple values at an index in one go.Chunknow also has aninsert_orderedmethod for inserting values into a sorted chunk.SparseChunknow has the methodsoption_iter(),option_iter_mut()andoption_drain()with their corresponding iterators to iterate over a chunk as if it were an array ofOptions.Arbitraryimplementations for all data types have been added behind thearbitraryfeature flag.
Release notes
Open source →ADDED
Chunknow has aninsert_frommethod for inserting multiple values at an index in one go.Chunknow also has aninsert_orderedmethod for inserting values into a sorted chunk.SparseChunknow has the methodsoption_iter(),option_iter_mut()andoption_drain()with their corresponding iterators to iterate over a chunk as if it were an array ofOptions.Arbitraryimplementations for all data types have been added behind thearbitraryfeature flag.
FIXED
- Internal consistency assertions are now only performed in debug mode (like with
debug_assert!). This meanssized_chunkswill no longer cause panics in release mode when you do things like pushing to a full chunk, but do bad and undefined things instead. It also means a very slight performance gain.
-
0.5.112 Dec 2019Release notes
Open source →ADDED
PoolDefaultandPoolCloneimplementations, from therefpoolcrate, are available forChunk,SparseChunkandRingBuffer, behind therefpoolfeature flag.
Release notes
Open source →ADDED
PoolDefaultandPoolCloneimplementations, from therefpoolcrate, are available forChunk,SparseChunkandRingBuffer, behind therefpoolfeature flag.
-
0.5.009 Sep 2019Release notes
Open source →CHANGED
- The
Bitmaptype (and its helper type,Bits) has been split off into a separate crate, namedbitmaps. If you need it, it's in that crate now.sized-chunksdoes not re-export it. Of course, this meanssized-chunkshas gainedbitmapsas its second hard dependency.
- The
-
0.4.002 Sep 2019Release notes
Open source →CHANGED
- The 0.3.2 release increased the minimum rustc version required, which should have been a major version bump, so 0.3.2 is being yanked and re-tagged as 0.4.0.
-
0.3.229 Aug 2019 withdrawnRelease notes
Open source →ADDED
- Chunk/bitmap sizes up to 1024 are now supported.
FIXED
- Replaced
ManuallyDropin implementations withMaybeUninit, along with a general unsafe code cleanup. (#3)
-
0.3.103 Aug 2019 -
0.3.017 May 2019Release notes
Open source →ADDED
- A new data structure,
InlineArray, which is a stack allocated array matching the size of a given type, intended for optimising for the case of very small vectors. Chunkhas an implementation ofFrom<InlineArray>which is considerably faster than going via iterators.
- A new data structure,
-
0.2.210 May 2019Release notes
Open source →ADDED
Slice::getmethods now return references with the lifetime of the underlyingRingBufferrather than the lifetime of the slice.
-
0.2.115 Apr 2019Release notes
Open source →ADDED
- A lot of documentation.
std::io::Readimplementations forChunk<u8>andRingBuffer<u8>to match theirWriteimplementations.
-
0.2.014 Apr 2019Release notes
Open source →CHANGED
- The
capacity()method has been replacied with aCAPACITYconst on each type.
ADDED
- There is now a
RingBufferimplementation, which should be nearly a drop-in replacement forSizedChunkbut is always O(1) on push and cannot be dereferenced to slices (but it has a set of custom slice-like implementations to make that less of a drawback). - The
Drainiterator forSizedChunknow implementsDoubleEndedIterator.
FIXED
SizedChunk::drain_from_front/backwill now always panic if the iterator underflows, instead of only doing it in debug mode.
- The
-
0.1.312 Apr 2019Release notes
Open source →ADDED
SparseChunknow has a default length ofU64.Chunknow hasPartialEqdefined for anything that can be borrowed as a slice.SparseChunk<A>likewise hasPartialEqdefined forBTreeMap<usize, A>andHashMap<usize, A>. These are intended for debugging and aren't optimally `efficient.ChunkandSparseChunknow have a new methodcapacity()which returns its maximum capacity (the number in the type) as a usize.- Added an
entries()method toSparseChunk. SparseChunknow has aDebugimplementation.
FIXED
- Extensive integration tests were added for
ChunkandSparseChunk. Chunk::clearis now very slightly faster.
-
0.1.211 Mar 2019 -
0.1.119 Feb 2019 -
0.1.019 Feb 2019