Trait bitcoin_internals::ToU64

source ·
pub trait ToU64 {
    // Required method
    fn to_u64(self) -> u64;
}
Expand description

A conversion trait for unsigned integer types smaller than or equal to 64-bits.

This trait exists because usize doesn’t implement Into<u64>. We only support 32 and 64 bit architectures because of consensus code so we can infallibly do the conversion.

Required Methods§

source

fn to_u64(self) -> u64

Converts unsigned integer type to a u64.

Implementations on Foreign Types§

source§

impl ToU64 for u8

source§

fn to_u64(self) -> u64

source§

impl ToU64 for u16

source§

fn to_u64(self) -> u64

source§

impl ToU64 for u32

source§

fn to_u64(self) -> u64

source§

impl ToU64 for u64

source§

fn to_u64(self) -> u64

source§

impl ToU64 for usize

source§

fn to_u64(self) -> u64

Implementors§