1.0.0-beta.1
Pre-release
Pre-release
Added
Marker::allocate_slice()
,Marker::allocate_slice_clone()
, and
Marker::allocate_slice_copy()
for creating slice allocations.Allocation::concat()
andAllocation::concat_unchecked()
for
concatenating two adjacent allocations into a single slice allocation.MarkerFront::append{,_clone,_copy}()
and
MarkerBack::prepend{,_clone,_copy}()
for extending existing allocations at
the end of their respective stacks with new data. This functionality is also
available through theMarker
trait using theextend{,_clone,_copy}()
methods (appending is always performed by front markers, and prepending is
always performed by back markers).IntoSliceAllocation
trait for safely coercingAllocation
instances into
allocations of slices. This is also used to determine what types can be used
for allocation concatenation (concat()
andconcat_unchecked()
allocation
methods) and extension (append*()
andprepend*()
marker methods).SliceLike
trait for performing conversions between DSTs that essentially
wrap some primitive slice type and the underlying slice type (e.g. between
str
and[u8]
), andConcatenateSlice
trait for markingSliceLike
types that can be safely concatenated without any additional verification
needed. This is used to allow for general use of such DSTs in allocations.- Various unit tests for edge cases (e.g. allocation extension safety, ZST
allocation support).
Changed
- Replaced the simple
Error
enum with anError
struct that provides the
error category (anErrorKind
enum variant based on the oldError
enum)
and any values whose ownership was intended to be passed to the callee. This
allows the caller to reuse such values if an operation fails instead of
simply throwing them away. - Replaced
Marker::concat()
withMarker::concat_slices_clone()
and
Marker::concat_slices_copy()
, which both work on general slices. - Use
NonNull<T>
for internal storage ofAllocation
pointers, allowing for
compiler optimizations such as reducingOption<Allocation<'marker, T>>
size to that of a single pointer.