[][src]Struct zebra_chain::block::hash::Hash

pub struct Hash(pub [u8; 32]);

A hash of a block, used to identify blocks and link blocks into a chain. ⛓️

Technically, this is the (SHA256d) hash of a block header, but since the block header includes the Merkle root of the transaction Merkle tree, it binds the entire contents of the block and is used to identify entire blocks.

Note: Zebra displays transaction and block hashes in big-endian byte-order, following the u256 convention set by Bitcoin and zcashd.

Trait Implementations

impl Arbitrary for Hash[src]

type Parameters = <[u8; 32] as Arbitrary>::Parameters

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default. Read more

type Strategy = Map<(<[u8; 32] as Arbitrary>::Strategy,), fn(_: ([u8; 32],)) -> Self>

The type of Strategy used to generate values of type Self. Read more

impl Clone for Hash[src]

impl Copy for Hash[src]

impl Debug for Hash[src]

impl<'de> Deserialize<'de> for Hash[src]

impl Display for Hash[src]

impl Eq for Hash[src]

impl<'a> From<&'a Block> for Hash[src]

impl<'a> From<&'a Header> for Hash[src]

impl FromStr for Hash[src]

type Err = SerializationError

The associated error which can be returned from parsing.

impl Hash for Hash[src]

impl PartialEq<ExpandedDifficulty> for Hash[src]

pub fn eq(&self, other: &ExpandedDifficulty) -> bool[src]

Is self equal to other?

See <ExpandedDifficulty as PartialOrd<block::Hash>::partial_cmp for details.

impl PartialEq<Hash> for Hash[src]

impl PartialEq<Hash> for ExpandedDifficulty[src]

pub fn eq(&self, other: &Hash) -> bool[src]

Is self equal to other?

See partial_cmp for details.

impl PartialOrd<ExpandedDifficulty> for Hash[src]

pub fn partial_cmp(&self, other: &ExpandedDifficulty) -> Option<Ordering>[src]

How does self compare to other?

See <ExpandedDifficulty as PartialOrd<block::Hash>::partial_cmp for details.

impl PartialOrd<Hash> for ExpandedDifficulty[src]

pub fn partial_cmp(&self, other: &Hash) -> Option<Ordering>[src]

block::Hashes are compared with ExpandedDifficulty thresholds by converting the hash to a 256-bit integer in little-endian order.

Greater values represent less work. This matches the convention in zcashd and bitcoin.

impl Serialize for Hash[src]

impl StructuralEq for Hash[src]

impl StructuralPartialEq for Hash[src]

impl ZcashDeserialize for Hash[src]

impl ZcashSerialize for Hash[src]

Auto Trait Implementations

impl RefUnwindSafe for Hash[src]

impl Send for Hash[src]

impl Sync for Hash[src]

impl Unpin for Hash[src]

impl UnwindSafe for Hash[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,