aboutsummaryrefslogtreecommitdiff
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-10-16prepare for 0.6 work (#428)Gravatar Carl Lerche 1-1/+1
2020-07-13v0.5.6v0.5.6v0.5.xGravatar Sean McArthur 1-1/+1
2020-07-09Change default lint level to warning and deny warnings in CI (#397)Gravatar Taiki Endo 1-6/+1
2020-07-09docs: Clarify what BytesMut is (#375)Gravatar Sean Leather 1-2/+6
2020-07-08BytesMut: Reuse buffer when data fully consumed via BufGravatar Bryan Donlan 1-3/+2
Closes #412
2020-07-05Add inline attribute to BytesMut::as_mut (#410)Gravatar Juan Aguilar 1-0/+1
2020-07-03Add inline attribute to BytesMut::set_len (#408)Gravatar Juan Aguilar 1-0/+1
2020-07-02Remove unnecessary synchronization when cloning shared representation (#404)Gravatar Tomasz Miąsko 2-2/+2
2020-06-18v0.5.5v0.5.5Gravatar Sean McArthur 1-1/+1
2020-05-27Remove outdated info on BytesMut::with_capacity (#394)Gravatar Mikhail Zabaluev 1-2/+1
Remove a remark from the doc that pertained to the inline layout and is no longer true.
2020-05-24Deny warnings for doc tests (#391)Gravatar Taiki Endo 6-10/+15
2020-05-22Fix reference in Take docs (#383)Gravatar Kirill Fomichev 1-1/+1
2020-05-22Format with rustfmt (#389)Gravatar Taiki Endo 15-299/+345
* Format with rustfmt * Add rustfmt check to CI
2020-05-22Update to loom v0.3 (#381)Gravatar Sean McArthur 3-24/+57
2020-03-25Fix #354 -- Make advance_mut impl of BufMut for Vec<u8> panic if cnt > remainingGravatar Tim Hambourger 1-5/+7
2020-03-24Fix #352 -- Make freeze respect the start offset for BytesMuts in Vec modeGravatar Tim Hambourger 1-1/+3
2020-01-23v0.5.4v0.5.4Gravatar Sean McArthur 1-1/+1
2020-01-23Do not panic on Bytes::slice_ref on empty slice (#355)Gravatar Stepan Koltsov 1-0/+6
Use case: ``` let bytes: Bytes = ... let subbytes = bytes.slice(a..b); // where a == b let slice = &subbytes[..]; let slice_bytes = bytes.slice_ref(slice); ``` Last line should not panic, because `slice` object is derived from the original `Bytes` object. Before this commit it panics, because `Bytes::slice` returns a fresh `Bytes` object when `begin == end`.
2020-01-23merge `hex` & `debug` into `fmt` (#357)Gravatar 南浦月 7-62/+61
2020-01-23Minor documentation fixes (#351)Gravatar Nikhil Benesch 1-8/+13
* Remove incorrect comment about behavior of put_slice * Improve grammar and clarity of BytesMut documentation
2020-01-23Fix reversed arguments in PartialOrd impls (#358)Gravatar Andrew Tunnell-Jones 2-10/+10
2020-01-23Assert that the alignment of Shared is appropriate (#362)Gravatar John-John Tedro 1-0/+6
2020-01-23rebuild_boxed_slice instead of rebuild_boxed_vec (#364)Gravatar Stepan Koltsov 1-5/+5
"Promotable" `Bytes` object is constructed from disassembling a boxed slice object, not a vec. Thus we should reassemble data into a boxed slice, not into a vec. Although, it does not create any problems in practice (`Box<[u8]>` is allocated exactly the same way as `Vec<u8>`), technically it is a violation of `Vec::from_raw_parts` spec which says that a pointer "needs to have been previously allocated via `String`/`Vec<T>`".
2020-01-22Fix Bytes::truncate losing the original Vec's capacity (#361)Gravatar Sean McArthur 1-1/+9
2020-01-09Make Bytes::new const fn (#356)Gravatar Stepan Koltsov 1-1/+11
2020-01-07Improve assertion messages (#349)Gravatar Sean McArthur 2-13/+57
2019-12-19Re-add impl From<BytesMut> for Bytes (#348)Gravatar Thayne McCombs 1-0/+6
2019-12-17Fix Bytes when Vec pointer's LSB is set (#346)Gravatar Sean McArthur 1-45/+82
This separates the `SharedVtable` into 3: - `PromotableEvenVtable`: The original `SharedVtable`, which will promote the `Vec` to `Shared` on the first clone, and is selected when the `Vec`'s pointer has the LSB unset. - `PromotableOddVtable`: Similar to the `PromotableEvenVtable`, but selected when the `Vec`'s pointer has the LSB set. This vtable differs in the masking used when reconstructing the `Vec`. - `SharedVtable`: This no longer checks if its current kind is `VEC` or `ARC`, and is only created by the "promotable" vtables. This also adds a test using an "odd" global allocator that purposefully bumps all pointers with alignment of 1. Closes #343
2019-12-12v0.5.3v0.5.3Gravatar Sean McArthur 1-1/+1
2019-12-12Assert the LSB is 0 when converting Vec into BytesGravatar Sean McArthur 1-3/+29
2019-12-12Fix conversion of empty vectors to BytesGravatar Steven Fackler 1-0/+7
Closes #340
2019-12-10Make Deref impls of Buf and BufMut forward more methodsGravatar Sean McArthur 2-24/+151
2019-12-10Optimize BufMut for Vec and BytesMut (#338)Gravatar Sean McArthur 2-6/+65
2019-12-04Add must_use to split, split_off, and split_toGravatar Sean McArthur 2-0/+59
2019-12-01Fix regression in Bytes::truncate (#333)Gravatar Mikhail Zabaluev 1-3/+1
When the length to truncate is greater than the buffer's current length, do nothing instead of clearing the contents.
2019-11-27v0.5.2v0.5.2Gravatar Sean McArthur 1-1/+1
2019-11-26Add accessors to Limit combinator (#325)Gravatar Sean McArthur 1-0/+41
2019-11-26chore: prepare v0.5.1 release (#322)v0.5.1Gravatar Steven Fackler 1-1/+1
2019-11-25doc: fix BytesMut growth documentation. (#321)Gravatar Steven Fackler 1-8/+3
2019-11-25prepare v0.5.0 release (#319)v0.5.0Gravatar Carl Lerche 1-4/+4
2019-11-25Export public the combinator types (#318)Gravatar Sean McArthur 1-4/+4
2019-11-20add BufMutExt::limit (#309)Gravatar Sean McArthur 2-0/+57
This type is the counterpart to BufExt::take. It limits how many bytes some `BufMut` can actually be filled with.
2019-11-20remove either feature (#315)Gravatar Carl Lerche 2-98/+0
remove either feature
2019-11-20implicitly grow BytesMut; add BufMutExt::chain_mut (#316)Gravatar Carl Lerche 3-16/+47
This brings `BytesMut` in line with `Vec<u8>` behavior. This also fixes an existing bug in BytesMut::bytes_mut that exposes invalid slices. The bug was recently introduced and was only on master and never released to `crates.io`. In order to fix a test, `BufMutExt::chain_mut` is provided. Withou this, it is not possible to chain two `&mut [u8]`. Closes #170
2019-11-20Make Bytes::from_static a const fn (#311)Gravatar Andrew Tunnell-Jones 1-1/+12
Rust versions bumped to the minimum needed for const slice len.
2019-11-13Change loom tests to use cfg(loom) internally (#314)Gravatar Sean McArthur 3-0/+72
2019-11-12Improve performance of `BytesMut::reserve` (#313)Gravatar Sean McArthur 1-0/+9
Makes the short-circuit checks inline-able, and the moves the actual reserving code to an inner function.
2019-11-04implement Buf for std::io::Cursor (#308)Gravatar Sean McArthur 1-0/+33
2019-10-31Move "extra" methods to extension traits (#306)Gravatar Sean McArthur 8-226/+164
2019-10-24Change BufMut methods that expose maybe-uninitialized bytes (#305)Gravatar Sean McArthur 5-46/+93
- The return type of `BufMut::bytes_mut` is now `&mut [MaybeUninit<u8>]`. - The argument type of `BufMut::bytes_vectored_mut` is now `&mut [bytes::buf::IoSliceMut]`. - `bytes::buf::IoSliceMut` is a `repr(transparent)` wrapper around an `std::io::IoSliceMut`, but does not expose the inner bytes with a safe API, since they might be uninitialized. - `BufMut::bytesMut` and `BufMut::bytes_vectored_mut` are no longer `unsafe fn`, since the types encapsulate the unsafety instead.