byte-slice-cast
Safely cast bytes slices from/to slices of built-in fundamental numeric types
1.2.3
59M downloads/mo
#1116 most downloaded on crates.io
sdroege/bytes-num-slice-cast
What this package is like to depend on
Last release 1 years ago
03 Mar 2025
Ships unpredictably
gaps range from 9 days to 2.3 years
Nearly every release is documented
notes for 14 of 14 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
14 releases · first in 2017
0 releases in the last 12 months
see the full history below
Release timeline
14 releases · Aug 2017 to Mar 2025
2018
2019
2020
2021
2022
2023
2024
2025
2026
Releases
latest 14-
1.2.303 Mar 2025 -
1.2.228 Oct 2022 -
1.2.125 Feb 2022Release notes
Open source →Changed
- Make trait methods
#[inline]. This allows the compiler to make the call a no-op in many cases.
- Make trait methods
-
1.2.019 Oct 2021Release notes
Open source →Added
- Trait impls for converting between
&[[T; N]]and&[u8]for specificT.
- Trait impls for converting between
-
1.1.016 Sep 2021Release notes
Open source →Added
ToByteSliceandToMutByteSliceimpl for&[()]. This always produces an empty byte slice.
-
1.0.013 Oct 2020Release notes
Open source →Removed
- Support for casting between
Vec<T>andVec<u8>. This was actually unsound as the alloc trait requires that memory is deallocated with exactly the same alignment as it was allocated with.
Fixed
usizetests on 16/32 bit architectures.
Changed
- Various documentation improvements.
- Support for casting between
-
0.3.522 Dec 2019Release notes
Open source →Changed
- Improve documentation and examples
Fixed
- Fix running of tests on 16/32 bit architectures
-
0.3.411 Nov 2019 -
0.3.302 Nov 2019 -
0.3.225 Jul 2019 -
0.3.105 Jun 2019Release notes
Open source →Fixed
- Casting of empty slices works correctly now instead of failing with an alignment mismatch error.
-
0.3.011 May 2019Release notes
Open source →Added
- The
Errortype now implementsClone.
Changed
AsByteSlice::as_byte_sliceandToByteSlice::to_byte_slicewere changed to always return&[u8]instead ofResult<&[u8], Error>.AsMutByteSlice::as_mut_byte_sliceandToMutByteSlice::to_mut_byte_slicewere changed to always return&mut [u8]instead ofResult<&mut [u8], Error>.- The
Displayimpl forErrornow produces more detailed error messages. - The variants of the
Errorenum were renamed.
- The
-
0.2.001 Jun 2018Release notes
Open source →Changed
- Major refactoring of how the traits work. It is now possible to work
directly on
AsRef<[T]>andAsMut<[T]>, e.g. onVec<T>andBox<[T]>.
Added
- Trait impls for i128 and u128.
- Major refactoring of how the traits work. It is now possible to work
directly on
-
0.1.014 Aug 2017