Releases: bluk/gen_value
v0.7.0
Added
-
Add
UnmanagedGenVec::set_gen()
to set the generation for an index.Allow directly setting the generation in extreme cases. The method
should not be used except in edge cases where an index has exhausted
all generations and all generational indexes have been dropped. -
Set Minimum Supported Rust Version (MSRV) to
1.56.0
Updated
- Separate benchmark code into separate crate
Removed
- Remove
thiserror
dependency and implement Error trait directly
v0.6.0
Updated
-
Use usize index for get_unchecked*
For performance reasons, change the get_unchecked* methods to use a
direct usize. Removes the need to pass in the entire generational
index and call the Into::into(). The assumption is that the
caller can get the index from the generational index into a usize.There may be multiple vectors which may need to be indexed using the
same index, so avoid having to possibly convert the generational index
into a usize index multiple times.In the worst case, the get_unchecked* method can be added via a trait
which has a generational index parameter and pass the usize index into
the get_unchecked* method.
v0.5.0
Updated
-
Rename UnmanagedGenVec::set_gen to set_next_gen
Panic if set_next_gen is called with more than next gen
UnmanagedGenVec.set_next_gen() must be called with the next generation of
the generational index. It is a logical error to call with generations
further ahead.The method can only set the generation to the next generation so
rename the method to better reflect the intent and capability. -
Rename UnmanagedGenVec::push to push_with_gen
Add push() with default generation
-
Panic on remove with last generation
For a managed indexes GenVec, the last generation is a tombstone
value which should never be returned. However, if the value were
manually constructed and used with remove, the method should panic to
indicate the program logic is incorrect because the value will remain
accessible -
Use usize for default generation type
Due to using a usize for the index type, using a smaller type for the
generation does not result in any memory savings (unless the
generational index type uses something besides the default (I, G)
tuple in a packed or space savings encoding).
Generally to save space, both the Index type and the Generation type
must be considered together so default to "expected" behavior while
callers can still customize behavior for their needs.
v0.4.0
Updated
-
Only allow set if the generations are equal
The generation in the Vec should always be the greatest generation
used. A generational index with a greater generation is
invalid. While it could be allowed, skipping generations should
be considered a logic bug because it wastes generations.IndexMut implementations are added for
GenVec
andUnmanagedGenVec
. -
Fix inconsistent error/panic in set vs set_or_push
If the index is out of bounds when calling set_or_push,
an error is returned instead of panicing. -
Fix default GenIndex type for UnmanagedGenVec
Type parameter specified (usize, u16) but should have been (I, G)
in case G or I is specified and they do not match the defaults.
v0.3.0
v0.2.0
Updated
- Added type parameters to
UnmanagedGenVec
for the indexI
and the
generational index typeGenIndex
. Adding the types constrains the
generational index to one type improving overall safety at the cost
of some flexibility. - Renamed
Index
type parameter inGenVec
toGenIndex
.