PackageTrack
Sign in Get early access

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
Release Pre-release

Releases

latest 14
  1. 1.2.3 03 Mar 2025
    Release notes

    Changed

    • Fix tests for Rust 1.81.
    • Declare Rust 1.51 as MSRV.
    Open source →
  2. 1.2.2 28 Oct 2022
    Release notes

    Changed

    • Fix a couple of clippy warnings in the tests.
    Open source →
  3. 1.2.1 25 Feb 2022
    Release notes

    Changed

    • Make trait methods #[inline]. This allows the compiler to make the call a no-op in many cases.
    Open source →
  4. 1.2.0 19 Oct 2021
    Release notes

    Added

    • Trait impls for converting between &[[T; N]] and &[u8] for specific T.
    Open source →
  5. 1.1.0 16 Sep 2021
    Release notes

    Added

    • ToByteSlice and ToMutByteSlice impl for &[()]. This always produces an empty byte slice.
    Open source →
  6. 1.0.0 13 Oct 2020
    Release notes

    Removed

    • Support for casting between Vec<T> and Vec<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

    • usize tests on 16/32 bit architectures.

    Changed

    • Various documentation improvements.
    Open source →
  7. 0.3.5 22 Dec 2019
    Release notes

    Changed

    • Improve documentation and examples

    Fixed

    • Fix running of tests on 16/32 bit architectures
    Open source →
  8. 0.3.4 11 Nov 2019
    Release notes

    Added

    • Support for casting between Vec<T> and Vec<u8>
    Open source →
  9. 0.3.3 02 Nov 2019
    Release notes

    Added

    • Support for usize and isize
    Open source →
  10. 0.3.2 25 Jul 2019
    Release notes

    Changed

    • Add no_std support
    • Migrate to 2018 edition
    Open source →
  11. 0.3.1 05 Jun 2019
    Release notes

    Fixed

    • Casting of empty slices works correctly now instead of failing with an alignment mismatch error.
    Open source →
  12. 0.3.0 11 May 2019
    Release notes

    Added

    • The Error type now implements Clone.

    Changed

    • AsByteSlice::as_byte_slice and ToByteSlice::to_byte_slice were changed to always return &[u8] instead of Result<&[u8], Error>.
    • AsMutByteSlice::as_mut_byte_slice and ToMutByteSlice::to_mut_byte_slice were changed to always return &mut [u8] instead of Result<&mut [u8], Error>.
    • The Display impl for Error now produces more detailed error messages.
    • The variants of the Error enum were renamed.
    Open source →
  13. 0.2.0 01 Jun 2018
    Release notes

    Changed

    • Major refactoring of how the traits work. It is now possible to work directly on AsRef<[T]> and AsMut<[T]>, e.g. on Vec<T> and Box<[T]>.

    Added

    • Trait impls for i128 and u128.
    Open source →
  14. 0.1.0 14 Aug 2017
    Release notes
    • Initial release of the byte-slice-cast crate.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive