rust-bitcoin-unsafe-fast/bitcoin/src/blockdata
Tobin C. Harding 579b76b7cb
Introduce ToU64 conversion trait
We already explicitly do not support 16 bit machines.

Also, because Rust supports `u182`s one cannot infallibly convert from a
`usize` to a `u64`. This is unergonomic and results in a ton of casts.

We can instead limit our code to running only on machines where `usize`
is less that or equal to 64 bits then the infallible conversion is
possible.

Since 128 bit machines are not a thing yet this does not in reality
introduce any limitations on the library.

Add a "private" trait to the `internals` crate to do infallible
conversion to a `u64` from `usize`.

Implement it for all unsigned integers smaller than `u64` as well so
we have the option to use the trait instead of `u32::from(foo)`.
2024-08-08 15:32:40 +10:00
..
script Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
block.rs Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
constants.rs Merge rust-bitcoin/rust-bitcoin#3067: Move `params` to the `network` module 2024-07-19 14:10:26 +00:00
mod.rs Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
transaction.rs Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
witness.rs Fix rustdocs in `blockdata` 2024-07-18 11:04:35 +01:00