Struct bitcoin::block::TxMerkleNode
source · pub struct TxMerkleNode(/* private fields */);
Expand description
A hash of the Merkle tree branch or root for transactions.
Implementations§
source§impl TxMerkleNode
impl TxMerkleNode
sourcepub fn from_raw_hash(inner: Hash) -> TxMerkleNode
pub fn from_raw_hash(inner: Hash) -> TxMerkleNode
Creates this wrapper type from the inner hash type.
sourcepub fn to_raw_hash(self) -> Hash
pub fn to_raw_hash(self) -> Hash
Returns the inner hash (sha256, sh256d etc.).
sourcepub fn as_raw_hash(&self) -> &Hash
pub fn as_raw_hash(&self) -> &Hash
Returns a reference to the inner hash (sha256, sh256d etc.).
Trait Implementations§
source§impl AsRef<[u8]> for TxMerkleNode
impl AsRef<[u8]> for TxMerkleNode
source§impl Borrow<[u8]> for TxMerkleNode
impl Borrow<[u8]> for TxMerkleNode
source§impl Clone for TxMerkleNode
impl Clone for TxMerkleNode
source§fn clone(&self) -> TxMerkleNode
fn clone(&self) -> TxMerkleNode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TxMerkleNode
impl Debug for TxMerkleNode
source§impl Decodable for TxMerkleNode
impl Decodable for TxMerkleNode
source§impl<'de> Deserialize<'de> for TxMerkleNode
impl<'de> Deserialize<'de> for TxMerkleNode
source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<TxMerkleNode, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<TxMerkleNode, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for TxMerkleNode
impl Display for TxMerkleNode
source§impl Encodable for TxMerkleNode
impl Encodable for TxMerkleNode
source§impl From<Hash> for TxMerkleNode
impl From<Hash> for TxMerkleNode
source§fn from(inner: Hash) -> TxMerkleNode
fn from(inner: Hash) -> TxMerkleNode
Converts to this type from the input type.
source§impl From<TxMerkleNode> for Hash
impl From<TxMerkleNode> for Hash
source§fn from(hashtype: TxMerkleNode) -> Hash
fn from(hashtype: TxMerkleNode) -> Hash
Converts to this type from the input type.
source§impl From<Txid> for TxMerkleNode
impl From<Txid> for TxMerkleNode
source§impl FromStr for TxMerkleNode
impl FromStr for TxMerkleNode
source§impl Hash for TxMerkleNode
impl Hash for TxMerkleNode
source§impl Hash for TxMerkleNode
impl Hash for TxMerkleNode
§type Engine = <Hash as Hash>::Engine
type Engine = <Hash as Hash>::Engine
A hashing engine which bytes can be serialized into. It is expected
to implement the
io::Write
trait, and to never return errors under
any conditions.source§const DISPLAY_BACKWARD: bool = true
const DISPLAY_BACKWARD: bool = true
Flag indicating whether user-visible serializations of this hash
should be backward. For some reason Satoshi decided this should be
true for
Sha256dHash
, so here we are.source§fn from_engine(e: Self::Engine) -> Self
fn from_engine(e: Self::Engine) -> Self
Produces a hash from the current state of a given engine.
source§fn from_slice(sl: &[u8]) -> Result<TxMerkleNode, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<TxMerkleNode, FromSliceError>
Copies a byte slice into a hash object.
source§fn from_byte_array(bytes: Self::Bytes) -> Self
fn from_byte_array(bytes: Self::Bytes) -> Self
Constructs a hash from the underlying byte array.
source§fn to_byte_array(self) -> Self::Bytes
fn to_byte_array(self) -> Self::Bytes
Returns the underlying byte array.
source§fn as_byte_array(&self) -> &Self::Bytes
fn as_byte_array(&self) -> &Self::Bytes
Returns a reference to the underlying byte array.
source§fn hash_byte_chunks<B, I>(byte_slices: I) -> Selfwhere
B: AsRef<[u8]>,
I: IntoIterator<Item = B>,
fn hash_byte_chunks<B, I>(byte_slices: I) -> Selfwhere B: AsRef<[u8]>, I: IntoIterator<Item = B>,
Hashes all the byte slices retrieved from the iterator together.
source§impl<I: SliceIndex<[u8]>> Index<I> for TxMerkleNode
impl<I: SliceIndex<[u8]>> Index<I> for TxMerkleNode
source§impl LowerHex for TxMerkleNode
impl LowerHex for TxMerkleNode
source§impl Ord for TxMerkleNode
impl Ord for TxMerkleNode
source§fn cmp(&self, other: &TxMerkleNode) -> Ordering
fn cmp(&self, other: &TxMerkleNode) -> Ordering
1.21.0 · 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
source§impl PartialEq<TxMerkleNode> for TxMerkleNode
impl PartialEq<TxMerkleNode> for TxMerkleNode
source§fn eq(&self, other: &TxMerkleNode) -> bool
fn eq(&self, other: &TxMerkleNode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<TxMerkleNode> for TxMerkleNode
impl PartialOrd<TxMerkleNode> for TxMerkleNode
source§fn partial_cmp(&self, other: &TxMerkleNode) -> Option<Ordering>
fn partial_cmp(&self, other: &TxMerkleNode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl SerdeHash for TxMerkleNode
impl SerdeHash for TxMerkleNode
source§fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
source§fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, s: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Do serde serialization.
source§fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Do serde deserialization.
source§impl Serialize for TxMerkleNode
impl Serialize for TxMerkleNode
source§impl UpperHex for TxMerkleNode
impl UpperHex for TxMerkleNode
impl Copy for TxMerkleNode
impl Eq for TxMerkleNode
impl StructuralEq for TxMerkleNode
impl StructuralPartialEq for TxMerkleNode
Auto Trait Implementations§
impl RefUnwindSafe for TxMerkleNode
impl Send for TxMerkleNode
impl Sync for TxMerkleNode
impl Unpin for TxMerkleNode
impl UnwindSafe for TxMerkleNode
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