rust-bitcoin-unsafe-fast/bitcoin/src
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
..
address Make ScriptBuf::p2wpkh_script_code stand alone 2024-07-23 11:24:31 -05:00
blockdata Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
consensus Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
crypto Merge rust-bitcoin/rust-bitcoin#3100: Bump MSRV to 1.63 2024-07-28 21:11:28 +00:00
merkle_tree Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
network Bump MSRV to 1.63 2024-07-27 07:24:32 +02:00
p2p Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
psbt Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
taproot Bump MSRV to 1.63 2024-07-27 07:24:32 +02:00
bip32.rs Merge rust-bitcoin/rust-bitcoin#2889: Move `serde_round_trip` macro to internals 2024-07-08 20:50:23 +00:00
bip152.rs Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
bip158.rs Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
consensus_validation.rs Add an extension trait for script validation 2024-07-29 07:48:07 -05:00
hash_types.rs bitcoin: remove all direct use of hashing/engines in unit tests 2024-06-24 13:58:03 +00:00
internal_macros.rs Introduce ToU64 conversion trait 2024-08-08 15:32:40 +10:00
lib.rs Bump MSRV to 1.63 2024-07-27 07:24:32 +02:00
policy.rs Remove usage of blockdata from paths 2024-06-20 12:00:22 +10:00
pow.rs Bump MSRV to 1.63 2024-07-27 07:24:32 +02:00
serde_utils.rs Bump MSRV to 1.63 2024-07-27 07:24:32 +02:00
sign_message.rs Remove wildcard from prelude import 2024-06-28 08:02:43 +01:00