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 @@
# Unified Element Constructor
This type is a hack around the fact that `Cell` and `AtomicUN` all have
`const fn new(val: Inner) -> Self;` constructors, but the numberic fundamentals
do not. As such, the standard library does not provide a unified construction
syntax to turn an integer fundamental into the final type.
This provides a `const fn BitElement::<_>::new(R) -> Self;` function,
implemented only for the `BitStore` implementors that the crate provides, that
the constructor macros can use to turn integers into final values without using
[`mem::transmute`]. While `transmute` is acceptable in this case (the types are
all `#[repr(transparent)]`), it is still better avoided where possible.
As this is a macro assistant, it is publicly exposed, but is not public API. It
has no purpose outside of the crate’s macros.
[`mem::transmute`]: core::mem::transmute.
+6
View File
@@ -0,0 +1,6 @@
# Register Descriptions
This trait describes the unsigned integer types that can be manipulated in a
target processor’s general-purpose registers. It has no bearing on the processor
instructions or registers used to interact with the memory bus, and solely
exists to describe integers that can exist on a system.
+28
View File
@@ -0,0 +1,28 @@
# Bit Storage Calculator
Computes the number of `T` elements required to store some number of bits. `T`
must be an unsigned integer type and cannot have padding bits, but this
restriction cannot be placed on `const fn`s yet.
## Parameters
- `bits`: The number of bits being stored in a `[T]` array.
## Returns
A minimal `N` in `[T; N]` that is not less than `bits`.
As this is a `const` function, when `bits` is also a `const` expression, it can
be used to compute the size of an array type, such as
`[u32; elts::<u32>(BITS)]`.
## Examples
```rust
use bitvec::mem as bv_mem;
assert_eq!(bv_mem::elts::<u8>(10), 2);
assert_eq!(bv_mem::elts::<u8>(16), 2);
let arr: [u16; bv_mem::elts::<u16>(20)] = [0; 2];
```