pub struct WitnessMerkleNode(/* private fields */);
Expand description
A hash corresponding to the Merkle tree root for witness data.
Implementations§
Source§impl WitnessMerkleNode
impl WitnessMerkleNode
Sourcepub fn from_raw_hash(inner: Hash) -> WitnessMerkleNode
pub fn from_raw_hash(inner: Hash) -> WitnessMerkleNode
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 WitnessMerkleNode
impl AsRef<[u8]> for WitnessMerkleNode
Source§impl Borrow<[u8]> for WitnessMerkleNode
impl Borrow<[u8]> for WitnessMerkleNode
Source§impl Clone for WitnessMerkleNode
impl Clone for WitnessMerkleNode
Source§fn clone(&self) -> WitnessMerkleNode
fn clone(&self) -> WitnessMerkleNode
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 WitnessMerkleNode
impl Debug for WitnessMerkleNode
Source§impl Decodable for WitnessMerkleNode
impl Decodable for WitnessMerkleNode
Source§impl<'de> Deserialize<'de> for WitnessMerkleNode
impl<'de> Deserialize<'de> for WitnessMerkleNode
Source§fn deserialize<D: Deserializer<'de>>(
d: D,
) -> Result<WitnessMerkleNode, D::Error>
fn deserialize<D: Deserializer<'de>>( d: D, ) -> Result<WitnessMerkleNode, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for WitnessMerkleNode
impl Display for WitnessMerkleNode
Source§impl Encodable for WitnessMerkleNode
impl Encodable for WitnessMerkleNode
Source§impl From<Hash> for WitnessMerkleNode
impl From<Hash> for WitnessMerkleNode
Source§fn from(inner: Hash) -> WitnessMerkleNode
fn from(inner: Hash) -> WitnessMerkleNode
Converts to this type from the input type.
Source§impl From<WitnessMerkleNode> for Hash
impl From<WitnessMerkleNode> for Hash
Source§fn from(hashtype: WitnessMerkleNode) -> Hash
fn from(hashtype: WitnessMerkleNode) -> Hash
Converts to this type from the input type.
Source§impl From<Wtxid> for WitnessMerkleNode
impl From<Wtxid> for WitnessMerkleNode
Source§impl FromStr for WitnessMerkleNode
impl FromStr for WitnessMerkleNode
Source§impl Hash for WitnessMerkleNode
impl Hash for WitnessMerkleNode
Source§impl Hash for WitnessMerkleNode
impl Hash for WitnessMerkleNode
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§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§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<WitnessMerkleNode, FromSliceError>
fn from_slice(sl: &[u8]) -> Result<WitnessMerkleNode, 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) -> Self
fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
Hashes all the byte slices retrieved from the iterator together.
Source§impl<I: SliceIndex<[u8]>> Index<I> for WitnessMerkleNode
impl<I: SliceIndex<[u8]>> Index<I> for WitnessMerkleNode
Source§impl LowerHex for WitnessMerkleNode
impl LowerHex for WitnessMerkleNode
Source§impl Ord for WitnessMerkleNode
impl Ord for WitnessMerkleNode
Source§fn cmp(&self, other: &WitnessMerkleNode) -> Ordering
fn cmp(&self, other: &WitnessMerkleNode) -> 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 for WitnessMerkleNode
impl PartialEq for WitnessMerkleNode
Source§impl PartialOrd for WitnessMerkleNode
impl PartialOrd for WitnessMerkleNode
Source§impl SerdeHash for WitnessMerkleNode
impl SerdeHash for WitnessMerkleNode
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 WitnessMerkleNode
impl Serialize for WitnessMerkleNode
Source§impl UpperHex for WitnessMerkleNode
impl UpperHex for WitnessMerkleNode
impl Copy for WitnessMerkleNode
impl Eq for WitnessMerkleNode
impl StructuralPartialEq for WitnessMerkleNode
Auto Trait Implementations§
impl Freeze for WitnessMerkleNode
impl RefUnwindSafe for WitnessMerkleNode
impl Send for WitnessMerkleNode
impl Sync for WitnessMerkleNode
impl Unpin for WitnessMerkleNode
impl UnwindSafe for WitnessMerkleNode
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)