Skip to content

Releases: tokio-rs/bytes

v0.5.6

14 Jul 00:59
Compare
Choose a tag to compare
  • Improve BytesMut to reuse buffer when fully advanced.
  • Mark BytesMut::{as_mut, set_len} with #[inline].
  • Relax synchronization when cloning in shared vtable of Bytes.
  • Move loom to dev-dependencies.

v0.5.5

14 Jul 00:59
Compare
Choose a tag to compare

Added

  • Allow using the serde feature in no_std environments (#385).

Fix

  • Fix BufMut::advance_mut to panic if advanced passed the capacity (#354)..
  • Fix BytesMut::freeze ignoring amount previously advanced (#352).

v0.5.4

23 Jan 18:42
Compare
Choose a tag to compare

Added

  • Make Bytes::new a const fn.
  • Add From<BytesMut> for Bytes.

Fix

  • Fix reversed arguments in PartialOrd for Bytes.
  • Fix Bytes::truncate losing original capacity when repr is an unshared Vec.
  • Fix Bytes::from(Vec) when allocator gave Vec a pointer with LSB set.
  • Fix panic in Bytes::slice_ref if argument is an empty slice.

v0.5.3

12 Dec 20:04
Compare
Choose a tag to compare

Added

  • must_use attributes to split, split_off, and split_to methods (#337).

Fix

  • Potential freeing of a null pointer in Bytes when constructed with an empty Vec<u8> (#341, #342).
  • Calling Bytes::truncate with a size large than the length will no longer clear the Bytes (#333).

v0.5.2

27 Nov 21:02
Compare
Choose a tag to compare

Added

  • Limit methods into_inner, get_ref, get_mut, limit, and set_limit (#325).

v0.5.1

26 Nov 22:21
Compare
Choose a tag to compare

Fix

  • Growth documentation for BytesMut (#321)

v0.5.0

26 Nov 22:20
b7c1f2a
Compare
Choose a tag to compare

Fix

  • Potential overflow in copy_to_slice

Changed

  • Increased minimum supported Rust version to 1.39.
  • Bytes is now a "trait object", allowing for custom allocation strategies (#298)
  • BytesMut implicitly grows internal storage. remaining_mut() returns
    usize::MAX (#316).
  • BufMut::bytes_mut returns &mut [MaybeUninit<u8>] to reflect the unknown
    initialization state (#305).
  • Buf / BufMut implementations for &[u8] and &mut [u8]
    respectively (#261).
  • Move Buf / BufMut "extra" functions to an extension trait (#306).
  • BufMutExt::limit (#309).
  • Bytes::slice takes a RangeBounds argument (#265).
  • Bytes::from_static is now a const fn (#311).
  • A multitude of smaller performance optimizations.

Added

  • no_std support (#281).
  • get_*, put_*, get_*_le, and put_*le accessors for handling byte order.
  • BorrowMut implementation for BytesMut (#185).

Removed

  • IntoBuf (#288).
  • Buf implementation for &str (#301).
  • byteorder dependency (#280).
  • iovec dependency, use std::IoSlice instead (#263).
  • optional either dependency (#315).
  • optional i128 feature -- now available on stable. (#276).