pub struct BlockHash(pub [u8; 32]);Expand description
A block hash in display order — the byte order bitcoind prints and a
chain document’s genesisHash uses; read as a big-endian number it
compares directly against a Target.
use sidestr_header::BlockHash;
let h = BlockHash::from_hex("000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f").unwrap();
assert_eq!(h.to_string(), "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
assert_eq!(h.to_wire()[0], 0x6f); // wire order is the reverse
assert_eq!(BlockHash::from_wire(h.to_wire()), h);Tuple Fields§
§0: [u8; 32]Implementations§
Trait Implementations§
impl Copy for BlockHash
impl Eq for BlockHash
Source§impl Ord for BlockHash
impl Ord for BlockHash
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for BlockHash
impl PartialOrd for BlockHash
impl StructuralPartialEq for BlockHash
Auto Trait Implementations§
impl Freeze for BlockHash
impl RefUnwindSafe for BlockHash
impl Send for BlockHash
impl Sync for BlockHash
impl Unpin for BlockHash
impl UnsafeUnpin for BlockHash
impl UnwindSafe for BlockHash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.