Vendor dependencies

This commit is contained in:
2026-08-01 16:11:49 +03:00
parent 7f139a0241
commit 6b5e7f0f8b
29706 changed files with 9575646 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
# Draining Iteration
This structure iterates over a subset of a bit-vector, yielding each bit and
removing it completely from the source.
Each drain locks the bit-vector that created it until the drain is either
destroyed or forgotten. If a drain is leaked rather than being allowed to drop
normally, the source bit-vector is only guaranteed to have contents up to the
original start of the drain. All further contents are unspecified.
See [`BitVec::drain()`] for more details.
## Original
[`vec::Drain`](alloc::vec::Drain)
[`BitVec::drain()`]: crate::vec::BitVec::drain
@@ -0,0 +1,10 @@
# Bit-Vector Extension by Proxy References
**DO NOT** use this. You *clearly* have a bit-slice. Use
[`.extend_from_bitslice()`] instead!
Iterating over a bit-slice requires loading from memory and constructing a proxy
reference for each bit. This is needlessly slow; the specialized method is able
to avoid this per-bit cost and possibly even use batched operations.
[`.extend_from_bitslice()`]: crate::vec::BitVec::extend_from_bitslice
+21
View File
@@ -0,0 +1,21 @@
# Bit-Vector Extension
This extends a bit-vector from anything that produces individual bits.
## Original
[`impl<T> Extend<T> for Vec<T>`][orig]
## Notes
This `.extend()` call is the second-slowest possible way to append bits into a
bit-vector, faster only than calling `iter.for_each(|bit| bv.push(bit))`.
**DO NOT** use this if you have any other choice.
If you are extending a bit-vector from the contents of a bit-slice, then you
should use [`.extend_from_bitslice()`] instead. That method is specialized to
perform upfront allocation and, where possible, use a batch copy rather than
copying each bit individually from the source into the bit-vector.
[orig]: https://doc.rust-lang.org/alloc/vec/struct.Vec.html#impl-Extend%3CT%3E
[`.extend_from_bitslice()`]: crate::vec::BitVec::extend_from_bitslice
+14
View File
@@ -0,0 +1,14 @@
# Fill Status
The standard library uses a `bool` flag to indicate whether a splicing operation
exhausted the source or filled the target, which is not very clear about what is
being signaled. This enum replaces it.
## Variants
- `FullSpan`: This marks that a drain span has been completely filled with
replacement bits, and any further replacement would require insertion rather
than overwriting dead storage.
- `EmptyInput`: This marks that a replacement source has been run to completion,
but dead bits remain in a drain span, and the dead range will need to be
overwritten.
@@ -0,0 +1,10 @@
# Bit-Vector Collection from Proxy References
**DO NOT** use this. You *clearly* have a bit-slice. Use
[`::from_bitslice()`] instead!
Iterating over a bit-slice requires loading from memory and constructing a proxy
reference for each bit. This is needlessly slow; the specialized method is able
to avoid this per-bit cost and possibly even use batched operations.
[`::from_bitslice()`]: crate::vec::BitVec::from_bitslice
@@ -0,0 +1,21 @@
# Bit-Vector Collection
This collects a bit-vector from anything that produces individual bits.
## Original
[`impl<T> FromIterator<T> for Vec<T>`][orig]
## Notes
This `.collect()` call is the second-slowest possible way to collect bits into a
bit-vector, faster only than calling `iter.for_each(|bit| bv.push(bit))`.
**DO NOT** use this if you have any other choice.
If you are collecting a bit-vector from the contents of a bit-slice, then you
should use [`::from_bitslice()`] instead. That method is specialized to
perform upfront allocation and, where possible, use a batch copy rather than
copying each bit individually from the source into the bit-vector.
[orig]: https://doc.rust-lang.org/alloc/vec/struct.Vec.html#impl-FromIterator%3CT%3E
[`::from_bitslice()`]: crate::vec::BitVec::extend_from_bitslice
@@ -0,0 +1,11 @@
# Bit-Vector Iteration
Bit-vectors have the advantage that iteration consumes the whole structure, so
they can simply freeze the allocation into a bit-box, then use its iteration and
destructor.
## Original
[`impl<T> IntoIterator for Vec<T>`][orig]
[orig]: https://doc.rust-lang.org/alloc/vec/struct.Vec.html#impl-IntoIterator
+17
View File
@@ -0,0 +1,17 @@
# Splicing Iteration
This adapts a [`Drain`] to overwrite the drained section with the contents of
another iterator.
When this splice is destroyed, the drained section of the source bit-vector is
replaced with the contents of the replacement iterator. If the replacement is
not the same length as the drained section, then the bit-vector is resized to
fit.
See [`BitVec::splice()`] for more information.
## Original
[`vec::Splice`](alloc::vec::Splice)
[`BitVec::splice()`]: crate::vec::BitVec::splice